Page 1 of 1

Lab Implementation

Posted: 2010-05-16T00:33:20-07:00
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

Re: Lab Implementation

Posted: 2010-05-22T01:32:22-07:00
by stupid
Bump!


Thanks.



Jo

Re: Lab Implementation

Posted: 2010-05-22T06:32:11-07:00
by magick
We are aware of the problem but we do not have an ETA on the solution.

Re: Lab Implementation

Posted: 2010-05-22T08:21:05-07:00
by stupid
Groovy! Baited breath etc.


Thanks for the heads up.



Jo

Re: Lab Implementation

Posted: 2010-05-23T12:16:39-07:00
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.

Re: Lab Implementation

Posted: 2010-05-24T03:53:05-07:00
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

Re: Lab Implementation

Posted: 2010-05-24T05:34:22-07:00
by magick
We're using a D50 white point. Does Photoshop use D65?

Re: Lab Implementation

Posted: 2010-05-24T07:23:49-07:00
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

Re: Lab Implementation

Posted: 2010-05-24T07:40:45-07:00
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.

Re: Lab Implementation

Posted: 2010-05-24T08:06:48-07:00
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

Re: Lab Implementation

Posted: 2010-05-24T08:52:59-07:00
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.

Re: Lab Implementation

Posted: 2010-05-25T01:52:13-07:00
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

Re: Lab Implementation

Posted: 2010-06-01T01:47:16-07:00
by stupid
Bump.

Any further thoughts on this?



Jo

Re: Lab Implementation

Posted: 2010-07-02T01:59:30-07:00
by stupid
Bump.

Re: Lab Implementation

Posted: 2012-02-28T14:28:10-07:00
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.