You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (Jira)" <ji...@apache.org> on 2022/08/17 02:40:00 UTC

[jira] [Comment Edited] (PDFBOX-5491) Transparency Group images slightly cropped

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

Tilman Hausherr edited comment on PDFBOX-5491 at 8/17/22 2:39 AM:
------------------------------------------------------------------

I played a bit with this and added a line that is identical to the clipping path and also saved the image of the transparency group. The line shows that the shape begins one pixel too low.
The image of the shape does also have one empty pixel line on top.

Changing {{minY = (int) Math.floor(bounds.getMinY());}} in {{PageDrawer.java}} to use "round" instead of "floor" brings a better image so this is definitively somewhere to look at.

{{bounds.getMinY()}} is 221.71 so {{floor}} reduces this to 221 which is almost a full pixel.

I tried to compensate this by adding {{g.translate(minX - bounds.getMinX(), minY - bounds.getMinY());}} before "flip y-axis", and also doing a better calculation for width/height {{Math.ceil(bounds.getWidth())}} but now it seems there's a bit missing on top.


Oh, the other file with the bullet points still looks terrible despite the changes.


was (Author: tilman):
I played a bit with this and added a line that is identical to the clipping path and also saved the image of the transparency group. The line shows that the shape begins one pixel too low.
The image of the shape does also have one empty pixel line on top.

Changing {{minY = (int) Math.floor(bounds.getMinY());}} in {{PageDrawer.java}} to use "round" instead of "floor" brings a better image so this is definitively somewhere to look at.

{{bounds.getMinY()}} is 221.71 so {{floor}} reduces this to 221 which is almost a full pixel.

I tried to compensate this by adding {{g.translate(minX - bounds.getMinX(), minY - bounds.getMinY());}} before "flip y-axis", and also doing a better calculation for width/height {{Math.ceil(bounds.getWidth())}} but now it seems there's a bit missing on top.


Oh, the other file with the bullet points still looks despite the changes.

> Transparency Group images slightly cropped
> ------------------------------------------
>
>                 Key: PDFBOX-5491
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5491
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 2.0.26
>            Reporter: Henry Iguaro
>            Priority: Major
>         Attachments: PDFBOX-5491-1-new.jpg, PDFBOX-5491-1-old.jpg, bullet-points-cropped.pdf, image-2022-08-11-14-50-33-042.png, image-2022-08-11-14-55-38-711.png, tg-cropped.pdf
>
>
> When importing the following file: [^tg-cropped.pdf]
> The resulting image (that comes from a Transparency Group) it's slightly cropped from the bottom:
> !image-2022-08-11-14-50-33-042.png!
> Similarly with this other file: [^bullet-points-cropped.pdf], the icons and bullet points are Transparency Groups that render slightly cropped.
> !image-2022-08-11-14-55-38-711.png!
> Increasing the `pageScale` in `PageDrawer` helps but you even when set it to 4x the artifact it's still noticeable.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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