Page 1 of 1

Color conversion differs on Mac an Linux

Posted: 2014-01-08T17:33:25-07:00
by mirek
Hey guys,

I'm converting CMYK to sRGB using color profiles and getting some weird results...

Firstly, I'm almost sure my input PDF file should use US Web Uncoated SWOP V2 (though I can't detect profile using identify -verbose) but when I use that as an input profile and put sRGB as the output profile, I'm still getting something very different from Illustrator with these profiles selected. Any ideas?

Secondly, I just noticed I'm getting very different output for the very same call, profiles, and IM version on Mac and Linux server.

This is what I do: convert -auto-orient -density 72 -flatten -background "#ffffff" -resize 572x1500 in.pdf[0] -profile USWebCoatedSWOP.icc -profile sRGB_v4.icc out.png

Here are my inputs and outputs: https://www.dropbox.com/sh/sdzqv8kdv803wt1/LSgXJHaKE8

MAC: convert --version
Version: ImageMagick 6.8.8-0 Q16 x86_64 2014-01-07 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules
Delegates: bzlib djvu fftw fontconfig freetype gslib jng jpeg lcms ltdl lzma png ps tiff webp x xml zlib

Server: convert --version
Version: ImageMagick 6.8.8-1 Q16 x86_64 2014-01-08 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib jng jpeg lcms png tiff x zlib

Re: Color conversion differs on Mac an Linux

Posted: 2014-01-08T19:57:10-07:00
by fmw42
convert -auto-orient -density 72 -flatten -background "#ffffff" -resize 572x1500 in.pdf[0] -profile USWebCoatedSWOP.icc -profile sRGB_v4.icc out.png
I do not know if this will make much difference, but I think it should be more like the following with the resize done in sRGB and not CMYK colors.

convert -auto-orient -density 72 -flatten -background "#ffffff" in.pdf[0] -profile USWebCoatedSWOP.icc -profile sRGB_v4.icc -resize 572x1500 out.png

There are different versions of these profiles (esp, the sRGB). Make sure you are using the very same profile (not just by name).

If you input pdf already has a CMYK profile (check via -verbose info:), then you should not add the cmyk profile. If the image shows no profile attached, then what you have should work fine.

The other issue is to be sure that you have the same versions of Ghostscript and libpng on the two systems.

gs --version
9.06


convert -list format

PNG* PNG rw- Portable Network Graphics (libpng 1.5.17)
See http://www.libpng.org/ for details about the PNG format.

Re: Color conversion differs on Mac an Linux

Posted: 2014-01-09T16:11:56-07:00
by mirek
Thanks!

Everything recomplied, I'm using gs 9.10 and libpng 1.6.8 on both systems now. I'm pretty sure exactly same icc profile files are being used but the results are still very different.

On Mac I actually get very close to the desirable result but on the server the colors still look like crap :\

Any other thoughts?

Btw if I do identify -verbose in.pdf there is a line saying "Gamma: 0.454545". No idea what it means, can't it be taken into account on the server only? The colors there are less saturated and lighter...

Re: Color conversion differs on Mac an Linux

Posted: 2014-01-09T17:28:33-07:00
by fmw42
Post the verbose information from both computers and the exact command line. That way we can see if there is some difference in the verbose information.

Are you still using:

Code: Select all

convert -auto-orient -density 72 -flatten -background "#ffffff" -resize 572x1500 in.pdf[0] -profile USWebCoatedSWOP.icc -profile sRGB_v4.icc out.png
I note from your first post that the server does not have ghostscript (gslib) listed as a delegate. You need ghostscript when reading pdf files.

Re: Color conversion differs on Mac an Linux

Posted: 2014-01-12T10:32:53-07:00
by mirek
Finally, resolved.

Convert used older version of Ghostscript when ran from PHP. Forcing it to use GS 9.10 made all the difference.

Thanks!