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.
Adjust CMYK colors correctly
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Adjust CMYK colors correctly
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
or convert to sRGB
or
Code: Select all
convert testicc.pdf -profile path2/USWebCoatedSWOP.icc result.pdf
Code: Select all
convert -colorspace sRGB testicc.pdf result.pdf
Code: Select all
convert testicc.pdf -profile path2/USWebCoatedSWOP.icc -profile path2/sRGB.icc result.pdf
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Adjust CMYK colors correctly
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.
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.
snibgo's IM pages: im.snibgo.com
Re: Adjust CMYK colors correctly
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".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
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
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.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.
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?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Adjust CMYK colors correctly
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:
The two converts can be combined into one.
Code: Select all
pdfimages -all tofix.pdf myimage
convert myimage.tif -profile ISOcoated_v2_eci.icc myimage.tif
convert myimage.tif tofix.pdf
snibgo's IM pages: im.snibgo.com
Re: Adjust CMYK colors correctly
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?
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?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Adjust CMYK colors correctly
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.
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.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Adjust CMYK colors correctly
"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.
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.
snibgo's IM pages: im.snibgo.com