Croped and replaced Image Retuns Black #1216
Replies: 7 comments 1 reply
-
This a known upstream bug: You have 2 options
So instead of your workaround just choose option 1 and do not let the method default to |
Beta Was this translation helpful? Give feedback.
-
Sorry, did not read your issue completely: rl = page.search_for("phone")
for r in rl:
page.add_redact_annot(r)
page.apply_redactions(images=fitz.PDF_REDACT_IMAGES_NONE) and so no black images at all. |
Beta Was this translation helpful? Give feedback.
-
Hi 'phone' is not an image hence its redacting. rl = page.search_for("067024") As an alternative I got the coordinates of "067024" and redacted using the following method 1.This returns black image
2.This returns like applying just a rectangle in the foreground but if we see in the background by editing pdf the keyword remains
3.This returns like removing all images related to "067024" 4.This returns the Black image Can I have the solution to remove "067024" without affecting anything others |
Beta Was this translation helpful? Give feedback.
-
No, not "<0677024>", because this is part of an image. You won't find string "<0677024>". |
Beta Was this translation helpful? Give feedback.
-
Hi , As Its is in the document apply_redaction(images=2) removes only the overlapping part of the image on which redaction is annotated. May I know why its blacked out all. Input image with the following code: Result after applying the following code |
Beta Was this translation helpful? Give feedback.
-
It also is documented, that this part of MuPDF code is not bug free. For images with a mask (transparency present), and also some black and white images, that logic is not (always) working. |
Beta Was this translation helpful? Give feedback.
-
Whoever fixes the transparent image apply reaction issues and the layered image issue described above will be reward with bitcoin worth 1000 Australian Dollar. Good luck!!! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Please provide all mandatory information!
Describe the bug (mandatory)
I am applying redaction on the following pdf .In that pdf the image area is blacked out during the redaction process, as an alternate I am trying with the pixmap the get the original image without blacked out and replaced it after the redaction process on that particular image. Could be helpful is there is any alternate solution for removing the blacked
combined-pdf-92.pdf
out image.
To Reproduce (mandatory)
I given the following apply_redactions() , apply_redactions(images=1) , apply_redactions(images=2)
Following is the code I used:
basepix = page.getPixmap(clip=fitz.Rect(image['bbox']),alpha=False)
page.addRedactAnnot(image['bbox'], fill=colors.to_rgb("white"), text=" ")
page.apply_redactions()
page.insert_image(image['bbox'],pixmap=basepix,overlay=True,keep_proportion=True)
Expected behavior (optional)
I expect the same image original image.
Screenshots (optional)
If applicable, add screenshots to help explain your problem.

Output Image
Input Image

Two images overwritten example

Your configuration (mandatory)
For example, the output of
print(sys.version, "\n", sys.platform, "\n", fitz.__doc__)
would be sufficient (for the first two bullets).Additional context (optional)
Add any other context about the problem here.
Beta Was this translation helpful? Give feedback.
All reactions