10

I'm working on a PHP script that automatically converts TIFF images to PNG files.

For that purpose, I use ImageMagick:

$ convert a.tif a.png

It works to some degree, however, the colours are very acute and deviant from the way they are pictured on my PC. To illustrate the problem, please have a look at the enclosed files, the include:

  • The Windows Live Foto Gallery output (that's pretty much how I want it to be)
  • The ImageMagick output (the mess I end up with)
  • The original TIFF file

Has anyone an idea whether, and if so how, I can alter the ImageMagick colour interpretation?

Thanks a lot!

clausvdb
  • 636
  • 2
  • 6
  • 13
  • 3
    Imagemagick seems to be interpreting the image as sRGB, and the actual colorspace info is embedded in a XMP metadata tag as an ICC profile, which it ignores. I don't know how to fix it though. – ergosys Jul 26 '10 at 22:53
  • 1
    Wow, that did the trick. I was able to download the ISO 12647-2:2004 ICC profile at eci.org and convert it to eciRGB (also to be found at eci.org). The result is even better than in Windows: http://cvdb.de/sonstiges/tiff/c.png $ convert -geometry 300 -profile ISOcoated_v2_eci.icc -profile eciRGB_v2.icc a.tif c.png did the trick. – clausvdb Jul 27 '10 at 09:21

2 Answers2

6

Alright,

thanks to ergosys, the problem was easily solved: I needed to apply ICC colour profiles. The XMP declared ISO 12647-2:2004, which was to be found at http://eci.org.

$ convert -profile ISOcoated_v2_eci.icc -profile eciRGB_v2.icc a.tif c.png
clausvdb
  • 636
  • 2
  • 6
  • 13
1

When converting from a CMYK color space to an RGB color space, as you do when going from tiff to png, you have to convert the color spaces along with the image. Try:

convert -colorspace rgb a.tif a.png

I ran this locally and get a better result from this than from the command line in your question, but my color vision sucks, so I can't guarantee that this is what you were after. =] Hope it gets you on the right track, anyway.

Sniggerfardimungus
  • 11,583
  • 10
  • 52
  • 97
  • Thanks for the idea, but the output doesn't change visibly. I will continue to search for the color space issue, though. http://cvdb.de/sonstiges/tiff/b.png – clausvdb Jul 26 '10 at 22:28