Created attachment 27132 [details] This is a screen capture to show the difference. I was building a website based on a design from a PDF. I got the pdf in my email, opened it up, and built the site. Then I looked at it on windows, and noticed that the colors in the PDF were way off. I am attaching a screenshot of evince and adobe reader, both on linux, side by side.
Any chance we can get the pdf file?
Created attachment 27141 [details] problem pdf
Renaming the bug, the problem is we don't handle the Matte entry
*** Bug 94132 has been marked as a duplicate of this bug. ***
Created attachment 121832 [details] [review] Implementation of matte entries in softmasks of softmasked images This patch implements it for splash :-D
I think that in for (int cp = 0; cp < nComps; cp++) { q[cp] = (*p) ? imgData->matteColor[cp] + (q[cp] - imgData->matteColor[cp]) * 255 / *p : q[cp]; } nComps should be destComps instead of nComps, otherwise on splashModeXBGR8 i get all kind of weird vertical artifacts.
Created attachment 121945 [details] [review] Implementation of matte entries in softmasks of softmasked images Here the correction to handle splashModeXBGR8 correct.
BTW, I made the same mistake as You when I first read the formula in the PDF spec: c′ = m + α * (c - m) where c′ is the value to be provided in the image source data c is the original image component value m is the matte colour component value α is the corresponding mask sample I also thought first that we have to calulate c′, but that is what is provided by the image source data!!! We have to calculate c!! <==> c = m + (c′ - m) / α And then we have to keep in mind that α is the opacity with value between 0..1, and since the mask has value between 0..255 we have to divide the mask sample by 255 or multiply with the inverse. This does the trick.
Still doesn't fix splashModeXBGR8 for me, see http://i.imgur.com/VSVjeyE.png
Created attachment 121959 [details] [review] Implementation of matte entries in softmasks of softmasked images Need to run over splashColorModeNComps, not over numComps of image, image is already converted to splash colorMode!
(In reply to Albert Astals Cid from comment #9) > Still doesn't fix splashModeXBGR8 for me, see http://i.imgur.com/VSVjeyE.png Sorry, Albert. The loop was completely wrong, not only for splashModeXBGR8. It just worked in the regression test because image colorspace RGB fits to splash colorspace. BTW, I think I already asked long time ago, but I forgot: how do You test the splashModeXBGR8???
(In reply to Thomas Freitag from comment #11) > BTW, I think I already asked long time ago, but I forgot: how do You test > the splashModeXBGR8??? I don't have autotests, i just run the file manually with qt4/test/test-poppler-qt4
Can you have a look at https://bugsfiles.kde.org/attachment.cgi?id=9140 ? I have the feeling the yellow boxes are a bit "too yellow" if compared to the rendering of Adobe Reader.
Created attachment 122027 [details] [review] Implementation of matte entries in softmasks of softmasked images This patch fixes the yellow color from regression from comment 13
Why do we ignore strDCT ?
(In reply to Albert Astals Cid from comment #15) > Why do we ignore strDCT ? Sorry, my mistake: when I started to look deeper in the results of my regression tests I encountered that I got huge problems with beamerexample1.pdf, there I got "dancing colors". And I thought that the reason was that the formula often runs into the clipping of pixels which sometimes "random" values. I thought that the reason was the usage of this lossy compression, and ignore this in a first step. After I got all other samples running I forgot that and upload the patch before thinking again about it.... But today I wasn't no more satisfied with that explanation and searched and searched what the reason could be, and I was just one step away to give completely up, but finally I now found the reason: In the PDF of comment 13 AND in the beamerexample1.pdf the alpha values were inverted (Decode [1 0]!!), and instead of use this for the matte color I have to correct the alpha value in the formula!
Created attachment 122062 [details] [review] Implementation of matte entries in softmasks of softmasked images Sorry for any inconvenience, but may You have again a look at this patch. It seems, as if it solves all our issues.
Pushed Thomas' patch, moving to cairo backend bug now.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/poppler/poppler/issues/73.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.