I am using svgs to display imgs in my pdf.
I need to use cmyk profile because the pdfs are printed and the printer use cmyk colors.
I replaced the fill color #66c430 with cmyk(48%,0%,76%,23%) (
https://www.colorhexa.com/66c430
)
after the pdf is created via prince i selected to color in gimp and it is more a #7bab69
Shouldn't the color stay the same when I use this function?
There is not a single formula for converting CMYK values to RGB values. The question is really meaningless until you specify which CMYK color space to convert from and which RGB color space to convert to. Even then, it's far from straightforward.
The website you referred is doing what is sometimes called a "naive" CMYK to RGB color conversion. It's a simple mathematical equation but the result is rather arbitrary.
When you specify a cmyk() color, two things happen:
Prince will embed an ICC profile to say what color space the CMYK values are in. This is controlled by the --pdf-output-intent or --fallback-cmyk-profile options.
The PDF viewer should use the ICC profile to convert CMYK values to the target color space (e.g. sRGB). A less sophisticated PDF viewer may convert CMYK values using its own fixed conversion table, or use the naive CMYK to RGB formula.
Thank you for your answer.
This doesn't seem the be a trivial Topic, I see.
We analyzed the pdf and they all have the Colorspace: "/ColorSpace /DeviceCMYK"
We gave the prince process his own icc file via the prince-wrapper (setPDFOutputIntent() and setFallbackCMYKProfile())
As far as I understand, the DeviceCMYK says: "use the CMYK Profil depending on the device"
What is to unreliable which color he displays.
I expected something there which indicates the .icc file we provided via the functions and not the deviceCMYK.
Am I mistaken here?
Does the javaprincewrapper throw errors if he doesn't find the provided icc-file in the path? Maybe he is just not using it?
EDIT: I tested it and if he doesn't find the icc the conversion failes. Like expected
So he uses the correct .icc file