-
The background of a PDF is white and when I extract the images, it returns black. I have created an environment where you can see the error, in the following link: The pdf that indicates this error is the following: I tried to remove the mask that I saw according to other previously opened cases, but this one only returns a mask and I cannot make it transparent. |
Beta Was this translation helpful? Give feedback.
Answered by
JorjMcKie
Jan 20, 2024
Replies: 1 comment 1 reply
-
You did not tell us the code you tried. This code works and is also documented! import fitz
doc=fitz.open("Big_Foot.pdf")
page=doc[0]
page.get_images()
[(12, 43, 2406, 2089, 8, 'DeviceRGB', '', 'X4', 'FlateDecode')]
basepix = fitz.Pixmap(doc,12)
maskpix = fitz.Pixmap(doc,43)
pix = fitz.Pixmap(basepix, maskpix)
pix.save("bigfoot.png") |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Pablituuu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You did not tell us the code you tried. This code works and is also documented!