Lab to custom profile (CMYK or RGB) conversion bug

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
Mike_B
Posts: 6
Joined: 2019-12-27T08:13:18-07:00
Authentication code: 1152

Lab to custom profile (CMYK or RGB) conversion bug

Post 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.

User avatar
fmw42
Posts: 26050
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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%)

User avatar
magick
Site Admin
Posts: 11149
Joined: 2003-05-31T11:32:55-07:00

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

Post 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).

User avatar
fmw42
Posts: 26050
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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.

snibgo
Posts: 12647
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

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

User avatar
dlemstra
Posts: 1606
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

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

Post 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%)
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate

User avatar
magick
Site Admin
Posts: 11149
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.

Post Reply