7.0.2, TIFF files with layers and colour conversion

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
gursch
Posts: 20
Joined: 2010-05-25T02:41:06-07:00
Authentication code: 8675308

7.0.2, TIFF files with layers and colour conversion

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: 7.0.2, TIFF files with layers and colour conversion

Post by snibgo »

"-profile rgb.icc" looks suspicious. Is this an sRGB profile, or RGB?

You link to png files, not a tiff.
snibgo's IM pages: im.snibgo.com
gursch
Posts: 20
Joined: 2010-05-25T02:41:06-07:00
Authentication code: 8675308

Re: 7.0.2, TIFF files with layers and colour conversion

Post 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).
Last edited by gursch on 2016-06-15T09:12:27-07:00, edited 1 time in total.
gursch
Posts: 20
Joined: 2010-05-25T02:41:06-07:00
Authentication code: 8675308

Re: 7.0.2, TIFF files with layers and colour conversion

Post by gursch »

Here is the download link for the colour profile:
https://drive.google.com/file/d/0B1k4Sj ... sp=sharing
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: 7.0.2, TIFF files with layers and colour conversion

Post 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.
snibgo's IM pages: im.snibgo.com
gursch
Posts: 20
Joined: 2010-05-25T02:41:06-07:00
Authentication code: 8675308

Re: 7.0.2, TIFF files with layers and colour conversion

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: 7.0.2, TIFF files with layers and colour conversion

Post 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.
snibgo's IM pages: im.snibgo.com
Post Reply