2

Example of the problem.

With this Lab/TIF image (amongst others):

http://cl.ly/3D2g0M1R4036

Running convert file1.tif file1.jpg results in this distorted result when run on my server, which is Ubuntu 12.04 LTS. This is running ImageMagick 6.6.9-7:

http://cl.ly/image/3P253v2y3L2x

The same command run locally on my Mac, does not have the same issue. I've tested this locally with the version of ImageMagick installed by HomeBrew (6.8.0-10) as well as 6.6.9-7 manually compiled to compare as closely with the server as possible.

I had suspected that it might have been the version of libtiff, as the Mac has 4.0.3, and the server has 3.9.5, however I've just run a test on a fresh Ubuntu install with latest ImageMagick, and libtiff 3.9.5, and the problem is still present.

Anything obvious?

Colin
  • 784
  • 2
  • 8
  • 21

1 Answers1

1

Running tiffinfo states that the colorspace of "file1.tif" is CIELab. Ubuntu's ImageMagick, installed through apt-get, will have Lab -- but not CIELab. This can be confirmed by running the following command between the two systems.

 identify -list colorspace

I'm not exactly sure what the difference between the two colorspaces are (something about chromatic value,) but that would contribute to the illumination your experiencing.

A solution would be to install ImageMagick from source on you Ubuntu server/machine (which will include CIELab). Other people have experienced related issues; which, resolved after building from source.

  • With apt-get
    • Uninstall ImageMagick
    • Install the development packages for each dependent library (ie libtiff-dev)
  • Follow ImageMagick's documentation

Update:

You can also explicitly set the colorspace with the -set option. Also add the -verbose options to evaluate what ImageMagick is doing.

convert -verbose file1.tiff -set colorspace CIELab -colorspace sRGB file1.jpg
# Output
file1.tif TIFF 1451x1865 1451x1865+0+0 8-bit CIELab 1.326MB 0.110u 0:00.109
file1.tif=>file1.jpg TIFF 1451x1865 1451x1865+0+0 8-bit sRGB 411KB 0.820u 0:00.840
Community
  • 1
  • 1
emcconville
  • 23,800
  • 4
  • 50
  • 66
  • Surprisingly, that appears to *not* have worked. I've installed libtiff8-dev (which depends on libjpeg8-dev) & installed ImageMagick from source. `identify -list colorspace` correctly shows CIELab. It has made a difference though as now the image is differently changed. I'm feeling very Warhol. http://cl.ly/image/0T1L0T180E1T – Colin Aug 21 '13 at 09:02
  • Odd. Seems to work for me with `libtiff4-dev`. Perhaps you will need to be specific about the colorspace conversion with the `convert` utility. I'll update the answer with an example. – emcconville Aug 21 '13 at 13:40
  • Sorry, it is indeed `libtiff4-dev` I have installed. Are you also testing on Ubuntu? I've tried it on a Fedora install and it's worked correctly (with ImageMagick installed via. Yum). I get a few differences in output - not sure if relevant - http://pastebin.com/raw.php?i=iZU7jN0k – Colin Aug 21 '13 at 15:48
  • Additionally after noticing the issue on the server, I've been testing on a virtual machine, so it's not isolated to the one box. – Colin Aug 21 '13 at 15:49