Summary: | Blended colors in CMYK color blending space rendered incorrectly | ||
---|---|---|---|
Product: | [Applications] okular | Reporter: | heinrich.bohne |
Component: | PDF backend | Assignee: | Okular developers <okular-devel> |
Status: | RESOLVED UPSTREAM | ||
Severity: | normal | CC: | aacid, heinrich.bohne |
Priority: | NOR | ||
Version First Reported In: | 23.08.1 | ||
Target Milestone: | --- | ||
Platform: | Microsoft Windows | ||
OS: | Microsoft Windows | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
This zip-archive contains a sample PDF file and two screenshots of the file rendered in Okular
This is an enhanced sample document with three texts as decribed in my previous comment. |
I have created a better sample document to demonstrate the problem more clearly. It contains the same text three times in a row. The middle text has the blend mode set to exclusion and the blending color space set to a CMYK profile. The first and the third text do not have a blend mode. The first text has its color hardcoded to the color that would result from the second text's blend being performed in RGB space, and the third text has the color hardcoded that would result from the blend being perfomed in a CMYK blending color space. Since the second text's blending color space is CMYK, its visible color should match that of the third text, as is the case when opening the file in the desktop version of Adobe Acrobat Reader (but not in the mobile version – this is an intended limitation of the mobile version to simplify and improve performance, so the effect can only be observed when using a desktop version of Acrobat Reader or Acrobat). However, when viewing the file in Okular with "overprint preview" disabled, the color of the second text is very similar to that of the first text, which means that the color blend is probably performed in an RGB space, albeit not the same one that was used in the source file from which the PDF file was created. Created attachment 184482 [details]
This is an enhanced sample document with three texts as decribed in my previous comment.
See my previous comment from 2025-08-26 19:32:17 UTC. I was not aware then that I could include a comment when uploading an attachment.
Can you confirm that pdftoppm has the same problem? If you mean the tool found on https://www.xpdfreader.com/ , then yes, the generated ppm file looks just like what is shown in Okular. I also just opened the PDF file in XpdfReader, which has a "DeviceN/overprint preview" option, and turning this option on and off has the same effect on the rendering of the blended color as the overprint preview option has in Okular. Does this mean that the bug in Okular is inherited from Xpdf? Right, apologies, i did not realize you are in windows and thus testing things is much harder for you. Anyhow, if this a bug (which i guess it is since Adobe Renders it differently than us), it's a bug in poppler, the library we use to render PDF files. Please open a bug in https://gitlab.freedesktop.org/poppler/poppler/-/issues/new?issue |
Created attachment 184436 [details] This zip-archive contains a sample PDF file and two screenshots of the file rendered in Okular I have a PDF file containing yellow text over a dark blue background, and the yellow text has the "exclusion" blend mode applied to it. The color blend space is in CMYK mode, but Okular appears to render the text color as if the blending space were an RGB space (I compared the resulting colors with the color Krita shows when I blend the two colors in an RGB and a CMYK space, and also with how Acrobat Reader displays this file and an almost identical file where the blending color space set to an RGB profile). Strangely enough, this only happens when "overprint preview" is disabled in the PDF backend settings. Upon enabling "overprint preview", the color is rendered correctly (or at least like in Acrobat Reader, which, seeing as the color displayed there appears to match the color I get in Krita when blending in CMYK, I presume is correct), even though the document does not contain any overprint and should therefore look the same with "overprint preview" enabled and disabled. I have attached a sample PDF file to demonstrate this behavior, along with two screenshots of how Okular renders the file with and without overprint preview. STEPS TO REPRODUCE 1. Open a PDF file that contains an element with a blend mode applied (in my case, the blend mode is exclusion, where the difference between blending in CMYK and RGB space is said to be particularly noticeable, but I presume the problem is the same with other blend modes), a CMYK color profile as a blending color space and overprint set to false. The element should be directly before a non-empty background. 2. Turn overprint preview off. OBSERVED RESULT The element in the foreground is shown as if the blending color space were in RGB mode. With the attached sample PDF file, the text is displayed with the color shown in screenshot 1. Whether this final blend color has been converted to the document's destination color space, I cannot tell. EXPECTED RESULT The element in the foreground is shown with a color resulting from blending the two source colors in the color space defined as the foreground element's blending color space, and only this resulting color should, if needed, be converted to the document's destination color space (in the case of the attached sample PDF file, the color should look something like in screenshot 2, which is what is displayed when overprint preview is turned on). SOFTWARE/OS VERSIONS Windows 10 Home edition, 64-bit (x64) Okular version: 23.08.1. This seems to be an old version, but it is the version I get from installing Okular via the Microsoft Store, which is the recommended way of installing Okular on Windows, according to the Okular website. However, I also tried opening the PDF file with the nightly 25.11.70 version, and the problem persisted, so it does not seem to have been fixed in the meantime.