Re: Retrieving impossible colour from Lab
One approach that may be interesting and is more graphical and qualitative as opposed to quantitative, spreadsheet manipulation is the following….toggle quoted messageShow quoted text
Start with a full Lab image (for example, make a new document in PS in Lab color - fill the L channel with L50, fill the a channel with a left-to-right, black-to-white linear gradient, zero smoothness, fill the b channel with a top-to-bottom, black-to-white gradient, zero smoothness. Make a set of Lab images, say in L10 increments, by duplicating the above document and replacing the L channel fill with L0, L10, L20 … L100.
Set the working color space for PS to the color space that you want to compare to Lab (for example, sRGB). Open one of the Lab images and simply change the mode from Lab to RGB - this will place the Lab colors into the current working color space. As Dan pointed out, real images do not change appearance very much, but the smooth gradients of color will show some banding and discontinuity when you perform this operation. The real interesting thing about this change of mode though, is the R, G and B channels in the RGB document, which are grayscale representations of the color. This is where, regardless of the ability of your color display, you can see clipping that occurs in the change from Lab to RGB - clipped values in each channel go to black. You can examine each channel and combine all of the channels’ grayscale images into a single grayscale image with BlendIf permitting you to threshold each of the three images (R, G and B channel representations) into a single image, against a white background layer, that shows you what it is gamut (white) and what has been clipped (black). Repeat this operation for each level of L that you made in the original L series of images. You can make an action that will automate the process after you open a L image:
1) Change the mode to RGB
2) Make a new layer above the background layer and fill with white
3) Make a new layer - Apply Image … Normal blend mode, Background layer, RED Channel
4) Make a new layer - Apply Image … Normal blend mode, Background layer, GREEN Channel
5) Make a new layer - Apply Image … Normal blend mode, Background layer, BLUE Channel
6 Select the BLUE layer and adjust the BlendIf by dragging the “This Layer” white slider down to a value like “5” or so - repeat for the GREEN and RED layers.
7) Stamp a copy of the resulting composite.
Now you have a binary image of the gamut for that slice of L. Not surprisingly, it looks like the gamut volume for sRGB in Lab coordinates. You can do this for any image, preferably by converting a raw digital camera image file directly into Lab (ACR will do this, as will some other raw converters). You can also mess with the fall off and threshold of the BlendIf operation to get the effect that you are looking for, in terms of how the boundary of the gamut appears in each image.
What is interesting is the abstract image that can result from layering the resulting binary images and compositing them - you can do this with a Smart Object (load images to stack and make a Smart Object) and then play with the Smart Object stack mode - Entropy is interesting. You might also get interesting effects if you combine different binary images into R, G and B channels of a new RGB document, producing a Harris Shutter kind of effect.
For a given pixel in your Lab document at a given X,Y image location, you could extract the L, a and b value of the pixel and perform a simple distance calculation (SQRT(a^2 + b^2)) at the pixel’s L plane and compare that distance to the distance of the sRGB gamut volume boundary on the specified L plane in the direction specified by the direction of the ab vector in Lab. If the ab distance is greater than the corresponding point intersected on the sRGB gamut volume boundary, then the result is “0” (OOG), else the result is “1” (in gamut).