Color conversion differs on Mac an Linux

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
mirek
Posts: 8
Joined: 2013-04-08T12:46:09-07:00
Authentication code: 6789

Color conversion differs on Mac an Linux

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Color conversion differs on Mac an Linux

Post 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.
mirek
Posts: 8
Joined: 2013-04-08T12:46:09-07:00
Authentication code: 6789

Re: Color conversion differs on Mac an Linux

Post 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...
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Color conversion differs on Mac an Linux

Post 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.
mirek
Posts: 8
Joined: 2013-04-08T12:46:09-07:00
Authentication code: 6789

Re: Color conversion differs on Mac an Linux

Post 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!
Post Reply