Jump to content

Why Photoshop lost colors with RGB to LAB convert?


Recommended Posts

<p>Hello everyone! Don't know is it a bug or not but here is what i find today when try convert 16 bit ProPhoto RGB gradient to LAB. As you can see the most saturated blue colors are destroyed. First i thought maybe its normal and maybe its some kind of inevitability conversion loss, but to be sure do some experiments. First i try to process same image with RawTherapee, which can use ProPhoto RGB as working space and internally converts images to LAB regarding <a href="http://www.rawtherapee.com/shared/documentation/RT-Internal-Workflow_2.4.pdf">this chart</a>. And it is DO NOT LOST any colors. Secondary i find that gradient generated in Photoshop in sRGB color space do not produse color loss too. So can anyone explain what happens there in Photoshop?<br>

<img src="http://album.foto.ru/photos/pr2/423507/3319960.jpg" alt="" width="512" height="512" /><img src="http://album.foto.ru/photos/pr2/423507/3319961.jpg" alt="" width="512" height="512" /><br>

p.s. also here is 3d plot of ProPhoto RGB vs LAB i done in Apple ColorSync Utility:<br>

<img src="http://album.foto.ru/photos/pr2/423507/3320024.jpg" alt="" width="628" height="616" /></p>

<p> </p>

Link to comment
Share on other sites

<p>Those are most likely color mapping errors within ACE color engine conversion as it attempts to draw the color managed preview representing a specific point within the non-uniform LAB space using euclidean math through the ICC display profile and onto the frame buffer of a video card. I've experienced this slight color shift with specific saturated colors when going from ProPhotoRGB to sRGB.</p>

<p>It's a minor issue considering Photoshop deals with millions of pixel colors that can conceal theses errors within the color relationship of a <strong>"photo",</strong> so ICC based conversions don't require the level of precision for both display and print that you demand and seem to want to nit pick about. It's old news and no one seems to be bothered by it except maybe those wanting better image editing software to distinguish within spectrum analysis of star gasses in astronomy. </p>

<p>It is not an important issue to be concerned over because it requires testing a million different color combinations to see which ones don't follow euclidean mapping.</p>

<p>I like talking like this because it makes me sound very authoritative on the subject much like you posting on your profound discovery using a specific piece of software. All in all nothing is solved or gained in the discussion because it is out of the controls of most photographers who really don't care about this. After discussing this subject so many times over the years I've come to not care about it either.</p>

Link to comment
Share on other sites

Dmitry,

 

In theory CIELAB can contain all of the colors available in the ProPhoto RGB space. The a and b values are

unbound and can 'in theory' be as large as you like.

 

However, common implementations, including Photoshop's and the profile connection space (PCS) used for ICC

profiles limits LAB's a & b to values between -128 and 127. ProPhoto has primaries that extend beyond this, so

they get clipped in conversion. If you set the color picker to show LAB values and look at the affected blue area

you'll see it top out at -128 in the b channel. When you make the gradient in sRGB space, it doesn't exceed these limits, so the conversion is smooth. I don't know how raw therapee works, so I can't comment on it.

 

Here's a thread from the colorsync list that talks about it a bit:

 

http://lists.apple.com/archives/colorsync-users/2007/Jul/msg00073.html

 

Here's a page from Bruce Lindbloom. About half way down it shows 2D charts of various spaces plotted against

the standard LAB limits. It should be pretty clear looking at this why clipping occurs:

 

http://www.brucelindbloom.com/index.html?WorkingSpaceInfo.html

Link to comment
Share on other sites

<p>so seems its a Photoshop and ColorSync limitation and RawTherapee developers find more nondestructive math for RGB-LAB convert, or maybe its due its 32 bit floating point engine. who knows... back to real life - after few tests it appears that RawTherapee do color noise reduction MUCH better than Photoshop in LAB, so i don't need to go to Photoshop LAB color mode anymore :) <br /> thanks for useful info!</p>
Link to comment
Share on other sites

Dmitry, you can't escape the fact that the extreme colors of the ProPhoto space don't really exist. They're not real and their

only purpose is to make the space large enough to accommodate a wider range of real colors.

 

The clipping that occurs in photoshop is a pretty reasonable way to handle this. After all you are asking it to show you

colors that can never exist. If Raw Therapee is showing you a smooth transition through these colors, then you can be sure

it is modifying all the colors surrounding the the imaginary ones. This also is a reasonable way to handle this, but not

necessarily better. All the techniques for addressing this are artificial crutches that gloss over the rough edges where theory

and reality diverge.

 

It's a pretty artificial problem because you will never encounter these colors in real life and can never reproduce them. It's a

fine example for understanding the underlying mechanics of color management, but most users of photoshop will never

notice this issue unless they like to spend a lot of time contemplating the granger rainbow.

Link to comment
Share on other sites

<p>Where and what produced the source for the Granger Rainbow test image? Was it Lab? A gamma encoded space? Your display? What source produced the test image for RawTherapee to perform its color mapping appearance of the Granger Rainbow?</p>

<p>What I'm getting at is you're trying to scientifically examine and quantify a synthetic image made in a synthetic environment in order to derive real and hopefully useful meaning behind what software does to a test image that isn't real.</p>

<p>You might as well measure and study how wet water is while having your lab in the middle of the ocean. Yes, objects under the water feel much wetter than when they are lifted out of the water without factoring in levels of humidity in the air.</p>

Link to comment
Share on other sites

"…why RawTherapee can and Photoshop can't? "

 

Dmitry, there a couple things a CMS can do.

 

One option is to simply re-map all the values to maintain smoothness at the expense of accuracy. This is basically what perceptual

rendering intent does. But, I think this would be pretty bad form for a RGB to LAB conversion and I doubt a developer would do this in

order to maintain smoothness in these extreme colors.

 

Another option (better in my opinion) is simply allow out-of-gamut color numbers and wait until the last possible moment to deal with

them. This allows you to go back and forth between profiles and PCS with minimal clipping along the way. LCMS does this and calls it

'unbounded mode' - basically you hang onto values above 100% and below 0% and handle it at the end. See here for juicy details:

 

http://www.littlecms.com/CIC18_UnboundedCMM.pdf

 

(If Raw Therapee uses LCMS2 under the hood, this would be a tidy answer to your question.)

Link to comment
Share on other sites

<p>as i wrote before i create new 16 bit file in regular ProPhoto RGB color space, gradient was generated with regular photoshop gradient tool.<br>

regarding real life - those colors can be in bright neon lights, leds, color lamp in the night, lighting, saturated tv screen in the dark... tons of examples, and all those blue colors beginning from 0 0 255 to somewhere 0 0 170 will be mapped after LAB to uniform flat 31 0 168.<br>

and same time RawTherapee shift 0 0 255 color only to 0 1 255<br>

btw, i find that green and red colors also dimmed numerically but it is not so visible in gradient due the color perception nature.<br>

i think i will try to ask about this phenomenon on RawTherapee forum...</p>

Link to comment
Share on other sites

"those colors can be in bright neon lights, leds, color lamp in the night, lighting, saturated tv screen in the dark"

 

No, they can't. The ProPhoto blue primary is imaginary—it is more saturated than pure monochromatic light, which is

not possible. Look at the standard graph here:

 

http://en.wikipedia.org/wiki/File:CIExy1931_ProPhoto.svg

 

The colored region contains all possible chromaticities. An ideal, pure blue laser will sit exactly on the boundary.

The blue primary of ProPhoto RGB (i.e. 0 0 255 and the lower left corner of the triangle) is way outside this. What this

means is that ALL colors in ProPhotoRGB of the form 0 0 X are imaginary. This includes not only the primary 0 0 255

but also shades of it like 0 0 170. Once you're in the area of 0 0 170 you are in a range the fits within photoshop's LAB

encoding so you'll start getting unclipped LAB values, but you're still in the land of imaginary colors until you start to

desaturate the color by adding either red or green.

Link to comment
Share on other sites

<p>its correct, if you shoot directly in ProPhotoRGB and don't edit image. in real life if you have a RAW file you usually add some contrast and same time boost those blue colors. (it can be understanding as upscaling of the saturaton. so its all depends of situation. take a look on this test image from BlackmagicDesign camera with its colors plot:</p><div>00c3HW-542937984.thumb.jpg.6993b32ae9a5ce9db845c4076c6cf4b9.jpg</div>
Link to comment
Share on other sites

<p>Dimitry, I took your example of "blue colors beginning from 0 0 255 to somewhere 0 0 170 will be mapped after LAB to uniform flat 31 0 168," and ran it through Bruce Lindbloom's calculator.</p>

<p>An original Prophoto RGB 0, 0, 255 maps to LAB 0.08, 90, -172. Since Photoshop can't go this far, I'd expect it to use LAB = 0, 90, -128. Converting THAT back to Prophoto RGB actually calculates to 30, -18, 168. But, since RGB values can't be negative, it presumably will clip to 30, 0, 168, which is pretty close to what you say you actually got.</p>

<p>So it seems pretty clear that your "errors" in Photoshop are because it has limited LAB a* and b* values to the range of -128 to 127. Presumably RawTherapee doesn't set those limits.</p>

<p>I think that Mark M has stated the situation very well. Regarding the imaginary primaries,it is impossible to have an actual such light source. In a way, they are like something I saw in cartoons as a kid - someone finds a "black light," and when they point it at something, it casts a black spot. Imaginary primaries are something of this sort; they have no real physical meaning, but are very useful mathematically.</p>

Link to comment
Share on other sites

<blockquote>

<p><strong>regarding real life</strong> - those colors can be in bright neon lights, leds, color lamp in the night, lighting, saturated tv screen in the dark... tons of examples, and all those blue colors beginning from 0 0 255 to somewhere 0 0 170 will be mapped after LAB to uniform flat 31 0 168.</p>

</blockquote>

<p>Those colors will not always and exactly be in those real objects due to human perception and device capture limits in exposure as well as contrast, saturation and hue variances inherent in real scenes that rely on color relationships within an image that can't possibly reproduce those exact color numbers you've indicated.</p>

<p>A Granger Rainbow is not a real representation of how a photo renders color. This is the reason there are rendering intents to allow smoother transitions into saturated colors from less vibrant ones such as shadow versions of saturated objects due to all the variances present in photographed subjects.</p>

<p>Also the Granger Rainbow uses black to create deep dark shadow transitions which is not part of reality or a real photo or a color print. The presence of absolute black violates human adaptive color appearance rendering models.</p>

<p>Vibrant flowers for example don't use black to create detail and definition in their petals, not even dark blue pansy's. There's always some color in what we see as black even when we photograph it under daylight depending on white balance which can also vary. Transitioning into black a vibrant cobalt blue polarized sky will never look right visually and most likely will have a lot of banding present in a print no rendering intent can fix.</p>

<p>Like I said photographic color reproduction is way too complicated to predictably map with precision. That's why we have digital image editors to horn-shoe what the software delivers from the camera what our eyes don't agree with.</p>

Link to comment
Share on other sites

<blockquote>

<p>its correct, if you shoot directly in ProPhotoRGB and don't edit image. in real life if you have a RAW file you usually add some contrast and same time boost those blue colors. (it can be understanding as upscaling of the saturaton. so its all depends of situation. take a look on this test image from BlackmagicDesign camera with its colors plot:</p>

</blockquote>

<p>One hard adjust to contrast either with sliders or reverse S-curve with tweaks to midrange will drastically change the <strong>"appearance"</strong> with regard to color transitions in what is seen as out/in gamut colors. The plotting of that image's gamut is pointless and lacking any significant use. Photography is not a closed system science project.</p>

Link to comment
Share on other sites

<p>people, i don't pretend to proof or un proof that those colors exist or not exist in real life. just like the idea to keep digital workflow 100% lossless, and point that the fact that there is a visual loss of information in one application and no loss in other.<br>

and looks like Bill C's calculations explain all things perfectly.</p>

Link to comment
Share on other sites

<blockquote>

<p>people, i don't pretend to proof or un proof that those colors exist or not exist in real life. just like the idea to keep digital workflow 100% lossless, and point that the fact that there is a visual loss of information in one application and no loss in other.</p>

</blockquote>

<p>For starters, don't convert to Lab! Next, work in high bit (16-bits per color) and in the color space the raw converter hands you which in the case of all Adobe raw converters is a variant of ProPhoto RGB. Then never edit your images because that will lead to some data loss. Doing as much of this work as possible on raw data, building rendering instructions to create a new ProPhoto RGB document will get you moving in the right direction in terms of minimal data loss. </p>

 

Author “Color Management for Photographers" & "Photoshop CC Color Management" (pluralsight.com)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...