Re: Retrieving impossible colour from Lab

Kirk Thibault

One approach that may be interesting and is more graphical and qualitative as opposed to quantitative, spreadsheet manipulation is the following….

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

Kirk Thibault

On Sep 8, 2020, at 9:53 AM, John Phillips <paulsimonrichards@...> wrote:

Your last sentence is a doozy.
Respectfully, I don't understand this comment.

While I understand that I am coming in from the left field somewhat, but I hope that my question comes across as valid within this group.
I am trying to produce an animation which paradoxically contains a wealth of colour information, yet cannot be seen with standard screen technology.

I am working with software developers for a well known 3D render engine to allow for Lab output of animation frames to produce OoG images from the jump.
If this is not possible then I will render in RGB and then undertake exaggerated Lab colour modifications in Photoshop, pushing the chroma values OoG.
I would then like to undertake some kind of boolean operation to separate the data which remains legal and that which is OoG. Rex's suggestion to work with Color Think Pro seems like a good starting point.

With this data I then hope to compile the animated frames as a video, ideally in L*a*b keeping the OoG data, but for the sake of final presentation the file will have to be converted back to sRGB
at which point I would like the OoG information to be more or less invisible on screen.

This may all seem rather silly, but it's a work that is accompanied by a full description of process and I would like to be as truthful to my materials and the Lab colour space as I can be.

Thanks for your time

Join to automatically receive all group messages.