Lab Implementation

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
stupid
Posts: 51
Joined: 2010-02-12T07:30:34-07:00
Authentication code: 8675308

Lab Implementation

Post by stupid »

Hi.

Like to draw your attention to a possible bug (or at least an inconsistency of implementation) in Lab when translating between colour spaces. Fuller explanation here: viewtopic.php?f=1&t=16223&p=58811&sid=0 ... 641#p58796


Thanks.



Jo
stupid
Posts: 51
Joined: 2010-02-12T07:30:34-07:00
Authentication code: 8675308

Re: Lab Implementation

Post by stupid »

Bump!


Thanks.



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

Re: Lab Implementation

Post by magick »

We are aware of the problem but we do not have an ETA on the solution.
stupid
Posts: 51
Joined: 2010-02-12T07:30:34-07:00
Authentication code: 8675308

Re: Lab Implementation

Post by stupid »

Groovy! Baited breath etc.


Thanks for the heads up.



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

Re: Lab Implementation

Post by magick »

We can repoduce the problem you posted and have a patch in ImageMagick 6.6.2-0 Beta available by sometime tomorrow. Thanks.
stupid
Posts: 51
Joined: 2010-02-12T07:30:34-07:00
Authentication code: 8675308

Re: Lab Implementation

Post by stupid »

Okay. I tested it, and you won't be surprised - it works!

Just for curiosity's sake; why are the L channel separations in PhotoShop, GIMP, etc. so much lighter in tone?

Anyway, thanks a lot - very speedy service. Cheers.



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

Re: Lab Implementation

Post by magick »

We're using a D50 white point. Does Photoshop use D65?
stupid
Posts: 51
Joined: 2010-02-12T07:30:34-07:00
Authentication code: 8675308

Re: Lab Implementation

Post by stupid »

Well, you've got me there. I've no access to PhotoShop (or GIMP), just their (converted) output files; but virtually everything to do with running anything on Windows has 6500K on it so you're likely right. My monitor calibration software says D65 with gamma 2.20.



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

Re: Lab Implementation

Post by magick »

We did compare the output of gimp to that of ImageMagick and it returned an RMSE of 0.0121 which suggests the pixels are fairly close in value.
stupid
Posts: 51
Joined: 2010-02-12T07:30:34-07:00
Authentication code: 8675308

Re: Lab Implementation

Post by stupid »

Standard deviations and their implications aren't really my bag but I get the general drift - the lower the number the better. My comparison was by eyeballing:

GIMP and original ImageMagick
Image

New ImageMagick
Image

Not complaining though; merely curious.



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

Re: Lab Implementation

Post by magick »

It could be a simple gamma adjustment or converting to sRGB rather than RGB. We're not sure. ImageMagick does follow the published standards for Lab to XYZ, XYZ to sRGB, and back.

Post a URL to your original Lab-encoded image and we'll download and take a closer look at the problem.
stupid
Posts: 51
Joined: 2010-02-12T07:30:34-07:00
Authentication code: 8675308

Re: Lab Implementation

Post by stupid »

Hi ho.

Original
http://img193.imageshack.us/img193/2889/img2641eg.jpg

ImageMagick: Separated L*a*b Lightness Channel
http://img143.imageshack.us/img143/4527 ... tnessc.jpg

GIMP: Decompose to L*a*b Lightness Channel
http://img641.imageshack.us/img641/1484 ... blight.jpg



Jo
stupid
Posts: 51
Joined: 2010-02-12T07:30:34-07:00
Authentication code: 8675308

Re: Lab Implementation

Post by stupid »

Bump.

Any further thoughts on this?



Jo
stupid
Posts: 51
Joined: 2010-02-12T07:30:34-07:00
Authentication code: 8675308

Re: Lab Implementation

Post by stupid »

Bump.
labs
Posts: 1
Joined: 2012-02-28T14:00:12-07:00
Authentication code: 8675308

Re: Lab Implementation

Post by labs »

Hello,

I've got the values (ImageMagick-6.7.5-7-Q16-windows.zip):
# ImageMagick pixel enumeration: 475,650,255,rgb
0,0: ( 51, 33, 12) #33210C rgb(51,33,12)
1,0: ( 48, 32, 10) #30200A rgb(48,32,10)
2,0: ( 60, 41, 14) #3C290E rgb(60,41,14)

# ImageMagick pixel enumeration: 475,650,255,lab
0,0: (112, 2, 19) #700213 lab(112,2,19)
1,0: (110, 1, 20) #6E0114 lab(110,1,20)
2,0: (123, 1, 20) #7B0114 lab(123,1,20)

# ImageMagick pixel enumeration: 475,650,255,xyz
0,0: ( 98,103, 71) #626747 xyz(98,103,71)
1,0: ( 95,100, 67) #5F6443 xyz(95,100,67)
2,0: (107,113, 80) #6B7150 xyz(107,113,80)


CCCEn.xls (http://ccc.orgfree.com/) for RGB 51, 33, 12 and D50 gives the values:
Lab 14.50 5.34 14.17
XYZ 2.0 1.8 0.6

It could be useful to have parameters to set X Y Z reference values.
Post Reply