[ 
https://issues.apache.org/jira/browse/PDFBOX-5403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17518337#comment-17518337
 ] 

Oliver Schmidtmer commented on PDFBOX-5403:
-------------------------------------------

Tried it with the following code:
{code:java}
                BufferedImage mask = pdImage.getImage();
                byte[] inv = new byte[256];
                for (int i = 0; i < inv.length; i++) {
                    inv[i] = (byte) (255 - i);
                }
                LookupTable table = new ByteLookupTable(0, inv);
                BufferedImage tmp = new BufferedImage(mask.getWidth(), 
mask.getHeight(), BufferedImage.TYPE_INT_RGB);
                mask = new LookupOp(table, 
graphics.getRenderingHints()).filter(mask, tmp);
{code}
Indeed that looks good on my PDF: However it breaks, also without the invert, 
https://issues.apache.org/jira/secure/attachment/12853106/gs-bugzilla692158-schleuse-veryslow.pdf
 and another PDF I currently can't share.

> Blurry / distorted rendering
> ----------------------------
>
>                 Key: PDFBOX-5403
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5403
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 2.0.25
>            Reporter: Oliver Schmidtmer
>            Priority: Major
>         Attachments: alpha_interpolation.patch, bad rendering.pdf, 
> image-2022-03-29-18-29-03-860.png, image-2022-03-30-14-39-12-855.png, 
> image-2022-03-31-11-55-36-061.png
>
>
> The attached PDF uses many stripes with an image and a mask.
> There seems to be an issue when mask and image are combined.
> !image-2022-03-29-18-29-03-860.png|width=518,height=91!



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to