Page 1 of 1

7.0.2, TIFF files with layers and colour conversion

Posted: 2016-06-15T02:56:48-07:00
by gursch
I have problems converting tiff files with layers from CMYK to RGB. The generated images have fancy colours in Photoshop (colours look OK in IrfanView). After merging the layers the colour conversion works perfectly, but I don’t want to lose the layers. I assume there is something going wrong with the colour profile.

ImageMagick version: ImageMagick 7.0.2-0 Q16 x64 2016-06-12 on Windows

Command used to do the conversion: convert test_with_layers.tif -profile rgb.icc out_with_layers.tif

Test images: https://drive.google.com/folderview?id= ... sp=sharing

Thanks for your help

Re: 7.0.2, TIFF files with layers and colour conversion

Posted: 2016-06-15T03:16:42-07:00
by snibgo
"-profile rgb.icc" looks suspicious. Is this an sRGB profile, or RGB?

You link to png files, not a tiff.

Re: 7.0.2, TIFF files with layers and colour conversion

Posted: 2016-06-15T09:05:43-07:00
by gursch
> Is this an sRGB profile, or RGB?

sRGB IEC61966-2-1 with BPC

> You link to png files, not a tiff.

You have to click on the images to get into the detail view and then to click on the download button. Else you get the preview images (are png).

Re: 7.0.2, TIFF files with layers and colour conversion

Posted: 2016-06-15T09:11:41-07:00
by gursch
Here is the download link for the colour profile:
https://drive.google.com/file/d/0B1k4Sj ... sp=sharing

Re: 7.0.2, TIFF files with layers and colour conversion

Posted: 2016-06-15T12:37:11-07:00
by snibgo
Clicking didn't work for me, probably because I wasn't logged in to Google.

The following commands:

Code: Select all

convert test_with_layers.tif -profile rgb.icc t1.tiff

magick  test_with_layers.tif -profile rgb.icc t2.tiff
... using v6.9.2-5 and v7.0.1-4 respectively both seem to work fine, each output being 3 images, from the 3 images in the input. The results as viewed in Microsoft Photo Viewer and Gimp look fine, with no "fancy colours".

Perhaps the file contain private Photoshop metadata, which IM doesn't touch, but PS reads so thinks the image is still CMYK. Try "-strip" before writing the output.

EDIT: The problem may be in the 8BIM structure, possibly "1082 Print Information" or "1083 Print Style". Try

Code: Select all

+profile "8bim"
... to prevent the 8bim being copied to the output.

Re: 7.0.2, TIFF files with layers and colour conversion

Posted: 2016-06-16T02:39:17-07:00
by gursch
It works correctly with -strip, it does not work with +profile "8bim". But you are right, it seems to be a Photoshop related issue. It works perfectly with GIMP. I will do some further investigations.

Re: 7.0.2, TIFF files with layers and colour conversion

Posted: 2016-06-16T02:48:47-07:00
by snibgo
Okay, if it works with "-strip", this is a workaround. However, "-strip" removes the embedded profile, so you should reassign it after stripping:

Code: Select all

convert test_with_layers.tif -profile rgb.icc -strip -profile rgb.icc t1.tiff
Because the input has an embedded profile, the first "-profile" converts the pixel data, and embeds the profile. Then it is stripped, so the second "-profile" merely embeds the profile without changing pixels.