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

Andreas Lehmkühler edited comment on PDFBOX-2934 at 9/26/15 8:46 PM:
---------------------------------------------------------------------

I've found several issues.

The parent paint context of the softmask paint takes an affine transformation 
into account but the softmask not. This explains the shifted/flipped soft 
masks. I didn't found a solution to solve that yet. I just did a diryt hack to 
add the missing translation to the soft mask. As result PDFJS-1710-p1.pdf and 
PDFJS-1710-p7.pdf are rendered correct.

There are obviously different rules on how to apply the soft mask. 
missing_imager.pdf attached to PDFBOX-1416 can be rendered if the alpha values 
are reverted. But I don't know how to determine when to revert those values. 
Maybe that reversion has to be done some where else.

The calculation of the alpha value was wrong. It must not be premultiplied but 
simply be copied to the alpha channel.

I've attached a patch demonstrating the issues and the dirty hack.





was (Author: lehmi):
I've found several issues.

The parent paint context of the softmask paint takes an affine transformation 
into account but the softmask not. This explains the shifted/flipped soft 
masks. I didn't found a solution to solve that yet. I just did a diryt hack to 
add the missing translation to the soft mask. As result PDFJS-1710-p1.pdf and 
PDFJS-1710-p7.pdf are rendered correct.

There are obviously different rules on how to apply the soft mask. 
missing_imager.pdf attached to PDFBOX-1416 can be rendered if the alpha values 
are reverted. But I don't know how to determine when to revert those values. 
Maybe that reversion has to be done some where else.

The calculation of the alpha value was wrong. It must not be premultiplied but 
simply be copied to the alpha channel.





> Support smask /S /Alpha
> -----------------------
>
>                 Key: PDFBOX-2934
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2934
>             Project: PDFBox
>          Issue Type: Task
>    Affects Versions: 2.0.0
>            Reporter: Tilman Hausherr
>         Attachments: PDFBOX2934_softmask.patch, PDFJS-1710-p1.pdf, 
> PDFJS-1710-p1.pdf-1-better.png, PDFJS-1710-p1.pdf-1.png, PDFJS-1710-p7.pdf, 
> PDFJS-1710-p7.pdf-1-better.png, PDFJS-1710-p7.pdf-1.png, 
> PDFJS-5526-p11-13.pdf, gs-bugzilla689439-alphamask.pdf
>
>
> The smask feature /S /Alpha is either not implemented or not working at all. 
> I have two files that are wrongly rendered with the current software, and 
> correctly rendered when the feature is disabled \(!\). As a first step, I am 
> disabling it for now and attach test files. Johns proposed patch has also 
> disabled the feature, so I think we can agree on that.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to