Lab Color Values in Photoshop and AppleScript
Lab Color Values in Photoshop and AppleScript
- Subject: Lab Color Values in Photoshop and AppleScript
- From: "Fleisher, Ken" <email@hidden>
- Date: Thu, 05 Jul 2007 08:25:22 -0400
- Thread-topic: Lab Color Values in Photoshop and AppleScript
Hello. I asked this question on the AppleScript-Users list, but no one
seemed to know the answer, so I thought I¹d try here:
I¹m trying to get a list of Lab colors from an image in Photoshop CS2. I am
pretty close, but I am getting a discrepancy between my a and b values in my
list and the corresponding values in the image (as reported by the color
picker). More specifically, I am measuring the colors in the image (which is
in Lab mode) using a single pixel eye dropper. I get the Lab values from
AppleScript using a single pixel selection and finding the histogram bin
that contains a ³1². Since the Lab values are reported as integers 0-255,
after getting the Lab values through my AppleScript I am converting them as
follows:
set L to L * (100 / 255)
set a to a - 128
set b to b 128
It is basically working, but there is a difference between my values and the
color picker values. I am assuming that this is somehow due to quantization
errors, but I can¹t figure out which is more correct and what I should use.
Also, it doesn¹t seem to be consistent if it¹s a simple round off error. I
am perfectly content with the L values since I can see how they round to the
values shown in the color picker. However, the a and b values are integers
which don¹t match up. The types of differences that I¹m seeing are evident
in the following two lists:
>From AppleScript:
{{0.0, 0, 0}, {0.0, 0, -12}, {5.098039215686, -17, 8}, {5.098039215686, -16,
-4}, {1.960784313725, 15, 3}, {1.960784313725, 16, -9}, {7.058823529412, -1,
11}, {7.058823529412, 0, 0}}
>From the color picker in Photoshop:
{{0,0,0}, {0,1,-12}, {5,-17,8}, {5,-16,-3}, {2,16,3}, {2,17,-8}, {7,-1,12},
{7,0,0}}
Any ideas why there is a discrepancy and which values are more correct? I
know the differences are small, but I don't understand why the values
wouldn't be the same.
Thanks.
--
Ken Fleisher
Photographer
Imaging & Visual Services
National Gallery of Art
Washington, D.C.
Phone: (202) 712-7471
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Colorsync-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden