Page 1 of 1

Lab to custom profile (CMYK or RGB) conversion bug

Posted: 2019-12-28T01:44:45-07:00
by Mike_B
I got strange results of conversion in version 7 compared to 6 (tried on windows, macos and linux):

Code: Select all

convert xc:"lab(112,25,-50)" -set profile Lab-D50-Identity-elle-V2.icc -intent absolute -profile ISOcoated_v2_eci.icc txt:
Result on ImageMagick 7.0.9-11:
0,0: (2028,62941,47537,7786) #07ECF5DDB9B11E6A cmyk(3.09453%,96.0418%,72.5368%,11.8807%)

Result on ImageMagick 6.9.10 (seems correct):
0,0: (45981,46184,0,0) #B39DB46800000000 cmyk(70%,70%,0%,0%)

I uploaded used icc profiles here.

Re: Lab to custom profile (CMYK or RGB) conversion bug

Posted: 2019-12-28T11:01:38-07:00
by fmw42
I can confirm using IM 6.9.10.82 and IM 7.0.9.12 on Mac OSX Sierra

IM 6:

Code: Select all

convert xc:"lab(112,25,-50)" -set profile /Users/fred/images/profiles/Lab-D50-Identity-elle-V4.icc -profile /Users/fred/images/profiles/USWebCoatedSWOP.icc -intent absolute txt:
0,0: (45942,48890,0,0) #B376BEFA00000000 cmyk(70%,75%,0%,0%)

IM 7:

Code: Select all

magick xc:"lab(112,25,-50)" -set profile /Users/fred/images/profiles/Lab-D50-Identity-elle-V4.icc -profile /Users/fred/images/profiles/USWebCoatedSWOP.icc -intent absolute txt:
0,0: (12918,62872,52644,6139) #3276F598CDA417FB cmyk(19.7116%,95.9365%,80.3296%,9.36751%)

Re: Lab to custom profile (CMYK or RGB) conversion bug

Posted: 2019-12-28T12:30:21-07:00
by magick
Curious. We're running the exact same ImageMagick releases and get

Code: Select all

0,0: (45981,46184,0,0)  #B39DB46800000000  cmyk(70%,70%,0%,0%)
for IMv7 and IMv6. Perhaps the release level of the LCMS library is a factor. We're using LCMS version 2.9-6 (IMv7) and 2.6-3 (IMv6).

Re: Lab to custom profile (CMYK or RGB) conversion bug

Posted: 2019-12-28T12:54:48-07:00
by fmw42
I was running lcms2 @2.9_1 (the latest from MacPorts) on both IM 6 and IM 7. Note I used different profiles from the OP. Nevertheless, IM 6 and IM 7 produced different results.

Re: Lab to custom profile (CMYK or RGB) conversion bug

Posted: 2019-12-28T13:12:32-07:00
by snibgo
I get the same results, on Windows 8.1 using pre-built IM binaries v6.9.9-50 (good result) and v7.0.8-64 (bad result).

How can I find what versions of LCMS are used?

Re: Lab to custom profile (CMYK or RGB) conversion bug

Posted: 2019-12-28T14:41:52-07:00
by dlemstra
It looks like this issue only occurs for the HDRI build:

Code: Select all

// HDRI
magick xc:"lab(112,25,-50)" -set profile Lab-D50-Identity-elle-V2.icc -intent absolute -profile ISOcoated_v2_eci.icc txt:
# ImageMagick pixel enumeration: 1,1,65535,cmyk
0,0: (2028,62941,47537,7786)  #07ECF5DDB9B11E6A  cmyk(3.09453%,96.0418%,72.5368%,11.8807%)

Code: Select all

// NO HDRI
magick xc:"lab(112,25,-50)" -set profile Lab-D50-Identity-elle-V2.icc -intent absolute -profile ISOcoated_v2_eci.icc txt:
# ImageMagick pixel enumeration: 1,1,65535,cmyk
0,0: (45981,46184,0,0)  #B39DB46800000000  cmyk(70%,70%,0%,0%)

Re: Lab to custom profile (CMYK or RGB) conversion bug

Posted: 2019-12-29T08:42:58-07:00
by magick
Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ https://www.imagemagick.org/download/beta/ by sometime tomorrow.