Skip to content

Image background returns black #3068

Answered by JorjMcKie
Pablituuu asked this question in Q&A
Discussion options

You must be logged in to vote

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")

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Pablituuu
Comment options

Answer selected by Pablituuu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants