Page 1 of 1
Adjust CMYK colors correctly
Posted: 2016-04-06T07:17:15-07:00
by gabw
I have created an good PDF here:
https://dev.codebrauer.de/notgit/testicc.pdf
The problem is, our software has some issues creating a correct CMYK PDF.
https://dev.codebrauer.de/notgit/tofix.pdf
What could be a way to correct the colors with convert to fix this?
We already tried to fix the color in the application itself, but we can't find the issue so we think to make it after the generation. Maybe it's easier than I thought.
I already tried with "-colorize" and "-tint" - But I couldn't achieve anything that looked somehow good.
Re: Adjust CMYK colors correctly
Posted: 2016-04-06T09:13:45-07:00
by fmw42
How do you know the colors are incorrect? You have not shown a correct color image? So it is hard for us to recommend something without testing and comparing. Nevertheless, the only thing I can suggest is to attach a proper CMYK profile
Code: Select all
convert testicc.pdf -profile path2/USWebCoatedSWOP.icc result.pdf
or convert to sRGB
Code: Select all
convert -colorspace sRGB testicc.pdf result.pdf
or
Code: Select all
convert testicc.pdf -profile path2/USWebCoatedSWOP.icc -profile path2/sRGB.icc result.pdf
Re: Adjust CMYK colors correctly
Posted: 2016-04-06T17:01:09-07:00
by snibgo
Extracting the images with pdfimages, and looking at pixel values in the solid blocks of cyan, magenta, yellow and black:
In testicc.pdf, which has no embedded profile, "cyan" is actually CMY = (78%, 20%, 0.4%). "Magenta" is CMY = (0, 95%, 10%). "Yellow" is CMY = (5%, 0, 87%). "Black" is CMY = (79%, 61%, 65%). Perhaps these values are not as I would expect because they have been converted to a profile, but the profile is not embedded.
File tofix.pdf is far worse. For example "cyan" is CMY=(90%, 47%, 6%). This looks like more than just a missing profile. Perhaps it has been through two stages of bad processing instead of just one.
What software made these PDFs? Either the software is wrong, or isn't being used correctly. Trying to correct these bad PDFs can only be done by guesswork, eg by assigning profiles.
Re: Adjust CMYK colors correctly
Posted: 2016-04-07T00:39:26-07:00
by gabw
fmw42 wrote:How do you know the colors are incorrect? You have not shown a correct color image? So it is hard for us to recommend something without testing and comparing. Nevertheless, the only thing I can suggest is to attach a proper CMYK profile
testicc.pdf was created in Photoshop CC - saved as PDF (CMYK) and all colors are picked picked directly - so I want that "tofix" has the same colors like "testicc".
The colors are incorrect - because the PDF "testicc" has the same color profile as the "tofix" PDF - I dragged both files in one document side by side - and saw the difference. By playing a bit with "color levels" in Photoshop I nearly got the right result - but I don't know how to accomplish this with IM.
Re: Adjust CMYK colors correctly
Posted: 2016-04-07T00:44:35-07:00
by gabw
snibgo wrote:Extracting the images with pdfimages, and looking at pixel values in the solid blocks of cyan, magenta, yellow and black:
In testicc.pdf, which has no embedded profile, "cyan" is actually CMY = (78%, 20%, 0.4%). "Magenta" is CMY = (0, 95%, 10%). "Yellow" is CMY = (5%, 0, 87%). "Black" is CMY = (79%, 61%, 65%). Perhaps these values are not as I would expect because they have been converted to a profile, but the profile is not embedded.
File tofix.pdf is far worse. For example "cyan" is CMY=(90%, 47%, 6%). This looks like more than just a missing profile. Perhaps it has been through two stages of bad processing instead of just one.
What software made these PDFs? Either the software is wrong, or isn't being used correctly. Trying to correct these bad PDFs can only be done by guesswork, eg by assigning profiles.
The software was made for us - it works fine, except this "small" problem – we already contacted them but there is no answer and we wanted to fix this asap.
We know the software works with ISOcoated_v2_eci.icc and IM already.
So the testicc file was (afaik) created with ISOcoated_v2_eci - But I can do another one. The point is, Is there any way to get the colors back to "normal" of the "tofix.pdf" file with IM?
Re: Adjust CMYK colors correctly
Posted: 2016-04-07T00:59:57-07:00
by snibgo
If the problem is simply that the profile wasn't embedded, then I suggest you extract it with pdfimages, assign the profile, and re-make the PDF:
Code: Select all
pdfimages -all tofix.pdf myimage
convert myimage.tif -profile ISOcoated_v2_eci.icc myimage.tif
convert myimage.tif tofix.pdf
The two converts can be combined into one.
Re: Adjust CMYK colors correctly
Posted: 2016-04-07T02:54:16-07:00
by gabw
ok I formulate all over again
we have a jpg "test.jpg" picture as start:
https://dev.codebrauer.de/notgit/test.jpg
This test.jpg we imported in photoshop and then exported with the following profile as a PDF:
ISOcoated_v2_eci.icc
See results here:
https://dev.codebrauer.de/notgit/test_r ... toshop.pdf
Then we have the same test.jpg imported into our application and then exported:
See results here:
https://dev.codebrauer.de/notgit/test_result_app.pdf
If you now compare both images the test_result_app is darker than the test_result_photoshop. how can we get this fixed now best way?
Re: Adjust CMYK colors correctly
Posted: 2016-04-07T09:35:44-07:00
by fmw42
Your input image test.jpg has a Coated FOGRA39.icc profile in it. When you exported your PDF from photoshop, it shows no profile for the pdf. Without extracting the imbedded image, I cannot tell what profile is associated with the internal image as opposed to the PDF shell.
Adding a CMYK profile to your "bad" pdf or even converting to sRGB does not seem to change the displayed result.
Not sure what to suggest other than use a different tool.
Re: Adjust CMYK colors correctly
Posted: 2016-04-07T12:04:52-07:00
by snibgo
"exiftool testicc.pdf" reports an ICC profile. But extracting the image with pdfimages, the image itself doesn't have a profile.
Experiment shows me that embedding a profile in an image, and wrapping that in PDF, is successful: Adobe Reader uses the profile.
But I don't know enough about how profiles should be used in PDFs, or what (if anything) Photoshop or the other app is doing wrong, or how to correct it.