CMYK to sRGB: issue with profiles

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
Lars-Daniel
Posts: 37
Joined: 2015-09-20T05:55:17-07:00
Authentication code: 1151

CMYK to sRGB: issue with profiles

Post by Lars-Daniel »

Hi there.
Version: ImageMagick 7.0.3-1 Q16 x64 2016-09-20
I've got some repro-images, which have been transformed to FOGRA39 (coated). For the web, I need to transfer them to sRGB.
In directory ~/profiles/ there are "sRGB-IEC61966-2-1.icc" and "CoatedFOGRA39.icc".

My commands:

Code: Select all

1. magick repro.tif -intent Relative -black-point-compensation -profile ~/profiles/sRGB-IEC61966-2-1.icc 01.tif
2. magick repro.tif -profile ~/profiles/CoatedFOGRA39.icc -intent Relative -black-point-compensation -profile ~/profiles/sRGB-IEC61966-2-1.icc 02.tif
My issue:
The resulting TIFFs don't have the same color! The color in "2" are darker. I've extracted the ICC profile from repro.tif - it's equal to the one in ~/profiles/. Seems like the profile in command "2" gets re-applied without checking. I've also transformed it using Photoshop. Of course, Photoshop uses Adobe's algorithms, but the colors of "1" does have a smaller delta than the colors of "2".

Best regards,
Lars-Daniel
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: CMYK to sRGB: issue with profiles

Post by fmw42 »

You probably should post your repro.tif image so the developers can test with it.

I am not an expert on profiles, but If your image already contains a profile, then I do not think you should provide it again. Just use the new sRGB profile. Your 1. is fine, but I do not think your 2. is proper.
Lars-Daniel
Posts: 37
Joined: 2015-09-20T05:55:17-07:00
Authentication code: 1151

Re: CMYK to sRGB: issue with profiles

Post by Lars-Daniel »

fmw42 wrote:You probably should post your repro.tif image so the developers can test with it.
I can't ... it's under copyright. But I'll create a small extract. There you go: https://ufile.io/caa1
fmw42 wrote:Your 1. is fine, but I do not think your 2. is proper.
But guess someone knows which profile was used to create the image, but missed to embedd the ICC.. Of course, he could use exiftools to embedd it, but "-profile" should better tell magick, which profiled colorspace is used. Right now, it does some unknown transformation.
Last edited by Lars-Daniel on 2016-10-02T15:03:38-07:00, edited 2 times in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: CMYK to sRGB: issue with profiles

Post by snibgo »

In your command (2), try four variations, with a different "-intent" before the first "-profile". Maybe try also with and without BPC.
snibgo's IM pages: im.snibgo.com
Lars-Daniel
Posts: 37
Joined: 2015-09-20T05:55:17-07:00
Authentication code: 1151

Re: CMYK to sRGB: issue with profiles

Post by Lars-Daniel »

snibgo wrote:In your command (2), try four variations,
Guess what? When re-arranging the settings (-intent Relative, BPC) to different positions, I'm getting various results. That's somehow confusing :shock:
snibgo wrote:with a different "-intent" before the first "-profile". Maybe try also with and without BPC.
Actually, I do want relative intent and BPC :?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: CMYK to sRGB: issue with profiles

Post by snibgo »

Lars-Daniel wrote:I've extracted the ICC profile from repro.tif ...
Lars-Daniel wrote:But guess someone knows which profile was used to create the image, but missed to embedd the ICC.
I'm confused. Does repro.tif contain an embeded profile or not?
snibgo's IM pages: im.snibgo.com
Lars-Daniel
Posts: 37
Joined: 2015-09-20T05:55:17-07:00
Authentication code: 1151

Re: CMYK to sRGB: issue with profiles

Post by Lars-Daniel »

snibgo wrote:
Lars-Daniel wrote:I've extracted the ICC profile from repro.tif ...
This means: I've extracted it from the image to verify that it's the same as in my directory. "Extract", neither "remove" nor "delete" ;)
snibgo wrote:I'm confused. Does repro.tif contain an embeded profile or not?
Sure it does:

Code: Select all

identify -verbose repro.tif | grep 'icc:description'
gives me:
Coated FOGRA39 (ISO 12647-2:2004)
Lars-Daniel
Posts: 37
Joined: 2015-09-20T05:55:17-07:00
Authentication code: 1151

Re: CMYK to sRGB: issue with profiles

Post by Lars-Daniel »

Hmm... Could anyone tell me the next steps to do?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: CMYK to sRGB: issue with profiles

Post by fmw42 »

Since your file includes the stated Coated FOGRA39 (ISO 12647-2:2004) CMYK profile, you should only use one sRGB profile to convert. The following works fine for me on IM 6.9.6.0 Q16 Mac OSX, except the intent is not converting to relative. Identify -verbose still shows perceptual. I can only assume that tiff does not support any other intent. Otherwise, it could be a limitation of libtiff. I am using LIBTIFF, Version 4.0.6. I am not sure if that is the latest.

Code: Select all

convert caa1-repro.tif -intent relative -profile /Users/fred/images/profiles/sRGB.icc caa1-repro_srgb.tif
To my eyes in several viewers they look the same coloring.

One of the IM developers will need to confirm why the relative intent is not showing in the verbose information.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: CMYK to sRGB: issue with profiles

Post by fmw42 »

I also tried the same command above but saving to png and it did not change the rendering intent to relative.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: CMYK to sRGB: issue with profiles

Post by snibgo »

IM (or a library) has become confused about intents, for example:

Code: Select all

f:\web\im>%IM%convert toes.png -intent absolute -profile sRGB_iec61966-2-1_black_scaled.icc r.png

f:\web\im>%IM%identify -verbose r.png | findstr intent
  Rendering intent: Perceptual
    png:sRGB: intent=3 (Absolute Intent)
One flag says it is perceptual, while another says it is absolute.

Tested under v6.9.5-3.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: CMYK to sRGB: issue with profiles

Post by fmw42 »

IM 6.9.6.0 Q16 Mac OSX

PNG* PNG rw- Portable Network Graphics (libpng 1.6.24)

I do not see your PNG:sRGB intent

Code: Select all

convert caa1-repro.tif -intent relative -profile /Users/fred/images/profiles/sRGB.icc caa1-repro_srgb.png

Code: Select all

  Rendering intent: Perceptual
  Gamma: 0.454545
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Background color: white
  Border color: srgb(223,223,223)
  Matte color: grey74
  Transparent color: black
  Interlace: None
  Intensity: Undefined
  Compose: Over
  Page geometry: 468x468+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Zip
  Orientation: Undefined
  Properties:
    date:create: 2016-10-06T22:51:37-07:00
    date:modify: 2016-10-06T22:51:37-07:00
    icc:copyright: sRGB built-in
    icc:description: sRGB built-in
    icc:manufacturer: (lcms internal)
    icc:model: sRGB built-in
    png:bKGD: chunk was found (see Background color, above)
    png:cHRM: chunk was found (see Chromaticity, above)
    png:iCCP: chunk was found
    png:IHDR.bit-depth-orig: 8
    png:IHDR.bit_depth: 8
    png:IHDR.color-type-orig: 2
    png:IHDR.color_type: 2 (Truecolor)
    png:IHDR.interlace_method: 0 (Not interlaced)
    png:IHDR.width,height: 468, 468
    png:pHYs: x_res=7499, y_res=7499, units=1
    png:text: 10 tEXt/zTXt/iTXt chunks were found
    png:tIME: 2016-10-06T17:39:33Z
    signature: af13c6b3d08275dfb62ac8b8e302bd849062e5e5a4367b7120f7b91cbbc8908c
    tiff:alpha: unspecified
    tiff:endian: lsb
    tiff:photometric: separated
    tiff:rows-per-strip: 140
  Profiles:
    Profile-icc: 6876 bytes
  Artifacts:
    filename: caa1-repro_srgb.png
    verbose: true
Lars-Daniel
Posts: 37
Joined: 2015-09-20T05:55:17-07:00
Authentication code: 1151

Re: CMYK to sRGB: issue with profiles

Post by Lars-Daniel »

Maybe I also should try the tools from ArgyllCMS. They might have better profile handling?
This seems interesting: http://www.argyllcms.com/icclibsrc.html
Post Reply