Luminous Landscape Forum

Raw & Post Processing, Printing => Digital Image Processing => Topic started by: Schewe on August 03, 2005, 11:42:08 am

Title: LAB -> RGB and adjustment layers
Post by: Schewe on August 03, 2005, 11:42:08 am
In reading the tutorial listed, I feel compelled to comment that there is ZERO reason for converting your RGB file to Lab mere;y for the purpose of adjusting luminance. You can easily accomplish essentially the same thing by creating a curves adjustment layer, set your settings and afterwards set the curves adjustment layer to a luminosity blend mode.

To be honest, converting an RGB image to Lab is a lossy operation-you get rounding and quantization errors in the conversion. That's not to say that working in Lab can't be useful for some things-it can-but it's simply silly to convert to Lab merely for the purpose of adjusting luminosity.

It's too bad really that the author of the tutorial fails to more fully explain the reason for the conversion to Lab. As best as I can tell, it's only for the purpose of seeing the readout in 0-100% instead of 0-255. Nothing else in the tutorial dictates that the technique needs to be in Lab.

Just because you read something on the web, do not automatically presume that it's correct.
Title: LAB -> RGB and adjustment layers
Post by: digitaldog on August 04, 2005, 09:13:36 am
-->Colour gurus such as Dan Margulis and Michael Kieran recommend a "trip" to the Lab mode Are they wrong?

In almost all cases, yes, certainly with 8-bit files (Dan doesn’t believe in anything more). You lose a heck of a lot of tones, depending on the original gamma of the working space. The question becomes whether it’s worth taking the time or worse, producing image degradation to convert from a working space to LAB and back. Every time a conversion to LAB is produced, the rounding errors and severe gamut mismatch between the two spaces can account for data loss, known as quantization errors. The amount of data loss depends on the original gamut size and gamma of the working space. For example, if the working space is Adobe RGB, which has 256 values available, converting to 8-bit LAB reduces the data down to 234 values. The net result is a loss of 22 levels. Doing the same conversions from ProPhoto RGB reduces the data to only 225 values, producing a loss of 31 levels.

One advantage of LAB is that since the colors (the A*axis and B*axis) are separate from the luminance (L*axis), it is possible to conduct tonal corrections that do not affect color. Hue shifts are avoided when changing lightness.

By and large, LAB editing is over-rated and with the tools in Photoshop, not often necessary.
Title: LAB -> RGB and adjustment layers
Post by: bobrobert on August 05, 2005, 11:35:50 am
Thanks for the interesting comments I have been using Lab to steepen the curves in the a b channels as recommended by Dan and Michael Is it worth converting to Lab to do this given the problems that has been outlined If not then the idea of converting is redundant? Under what circumstances is it worth the conversion? TIA
Title: LAB -> RGB and adjustment layers
Post by: PeterLange on August 09, 2005, 06:20:58 pm
Quote
The first trip from RGB to Lab is the one that introduces the data drop-after the first trip, additional moves to and back from RGB>Lab>RGB don't do much if anything to a file.
 
The ironic part of the story is that ProPhotoRGB is even larger than CIE Lab.

CIE LAB:  2,381,085 deltaE3
ProPhotoRGB:  2,879,568 deltaE3
Source: Bruce Lindbloom

Lab data get afraid when they see ProPhotoRGB, not vice versa.  However, at 16 bit/ch – good luck to show any quantization effects in whatever direction.


The more exiting question is about the architecture of Lab / Luminosity mode in principal.  The mythos that any of both separates Tone from Color is only true on a static basis.  As soon as you make moves, color integrity gets lost.  Admittedly, both are often better than plain RGB, however not necessarily - see my previous post.

A fundamental discussion about color models for image editing wouldn’t be bad ... IMO.  It seems that cognoscente like Norman Koren or Gernot Hoffmann have their own preferences in this regard.

Peter


P.S.: Mark’s question is excellent … IMO.
--
Title: LAB -> RGB and adjustment layers
Post by: digitaldog on August 12, 2005, 11:50:12 am
Quote
Using 16 bit in PS prevents rounding errors but we do not have nearly the number of levels that we might think. Is this true?
Well a few things. Photoshop actually works in 15 bits...

The idea is to end up with the best 8 bits per color. So “high bit files” (these with more than 8-bits per channel which Photoshop calls “16-bit) just allows us the means of tossing bits which is enviable but end up with 8 good bits of data for output. There are still rounding errors with just about any tone/color adjustment.

The calculator shows the loss of 8-bit files based on the gamma mismatches between spaces. It’s nothing to get super worried about but something to keep in mind. So there’s a data loss involved with 8-bit LAB conversions plus the time it takes to do this and the question whether it’s even necessary based on tools available within Photoshop. Some tools are not there, so if you do take the time to convert into LAB, at least try to do this on high bit data.
Title: LAB -> RGB and adjustment layers
Post by: Hermie on August 13, 2005, 01:31:54 pm
Quote
One of the very few moves which are even in line with David Dunthorn’s basic paper on color integrity in digital imaging.
For those who haver never heard of David Dunthorn,
this is the document Peter is referring to:

http://www.c-f-systems.com/Docs/ColorIntegrityCFS-243.pdf (http://www.c-f-systems.com/Docs/ColorIntegrityCFS-243.pdf)
http://www.c-f-systems.com/ColorIntegrity.html (http://www.c-f-systems.com/ColorIntegrity.html)

Herman
Title: LAB -> RGB and adjustment layers
Post by: omwoods on August 03, 2005, 06:44:30 am
I would appreciate a little help with PS7. I've used PS since v5, mainly for graphics work, but now following a new camera purchase, raw workflow and so on I'm finding myself using PS to do photo editing too, not my area of 'expertise' if you will! I've googled and searched this forum, but found no direct answer to my query.

After reading the Curves command primer (http://www.luminous-landscape.com/tutorials/command_primer.shtml) and consequently working with the LAB colour space, I've carried out my adjustment layers modifications (curves and hue). Now moving back to RGB I am greated with a "Changing modes will discard some adjustment layers; change mode anyway?" dialog box, with Ok, cancel or flatten as options.  Now I thought the idea with adjustment layers was to allow the possibility of future editing - flatten prevents this, and ok loses my adjustment layers altogether! Any ideas on how to preserve this functionality?

Many thanks,
Oliver
Title: LAB -> RGB and adjustment layers
Post by: Hermie on August 03, 2005, 09:33:56 am
>After reading the Curves command primer and consequently working with the LAB colour space

In believe that it's a bit overdone to do your tonal corrections in lab. So forget about lab, just work on the file in RGB mode and set the layer mode of the curves adjustment layer to luminosity.

Herman
Title: LAB -> RGB and adjustment layers
Post by: omwoods on August 03, 2005, 12:30:58 pm
Quote
Just because you read something on the web, do not automatically presume that it's correct.
I didn't automatically assume it is correct: perhaps I failed to word my original post correctly; I was inquiring how others maintained functionality when using this method - obviously those who've replied believe it to be a poor method in terms of image quality. I've used the luminosity blending mode in my work before, but thought I'd try out a new method, guess I should stick to what I know works next time!

Thanks for your replies,
Oliver
Title: LAB -> RGB and adjustment layers
Post by: bobrobert on August 04, 2005, 05:05:41 am
Colour gurus such as Dan Margulis and Michael Kieran recommend a "trip" to the Lab mode Are they wrong? Indeed Dan Margulis is shortly publishing a book on the subject It is the a b channels that have the most benefit I am far from being knowledgable on the subject, but it's hard to believe from the above posts that these two eminent authors have got it wrong!
Title: LAB -> RGB and adjustment layers
Post by: Schewe on August 04, 2005, 12:47:16 pm
Quote
Colour gurus such as Dan Margulis and Michael Kieran recommend a "trip" to the Lab mode Are they wrong? Indeed Dan Margulis is shortly publishing a book on the subject It is the a b channels that have the most benefit I am far from being knowledgable on the subject, but it's hard to believe from the above posts that these two eminent authors have got it wrong!

If you are asking if there are no valid reasons for a trip to Lab for specific color or tone corrections that is best done (or can only be done) in Lab, no, Margulis & Kieran and others will point to the sometimes obscure but very real advantages of doing some edits in Lab. But if you are asking whether taking an RGB image into Lab is a "normal" or productive thing to do for purposes not specifically benfiting a Lab trip, then yes, it's wrong.

While not exactly the same as Lab, the Luminosity layer blend mode is close enough that converting to Lab to sharpen luminosity for example is a wasted effort. Same thing with converting to Lab for the purposes of applying a luminosity curve. It's counter productive.

There are specific controls you can apply in Lab or even CMYK mode that can not be duplicated by working in RGB. But, as Andrew suggests, unless you spcifically need those controls (rare indeed) you are better off learning how to use the power of Photoshop's color and tone controls in RGB before jumping over to Lab.

As for Dan's Lab book...I saw the press proof last week so it will be out soon. I'll be interested in finding out how Dan was able to fill an entire book with Lab techniques. . .I'm sure there will be some interesting gems as well as the typical Dan-Speak.
Title: LAB -> RGB and adjustment layers
Post by: Schewe on August 04, 2005, 12:51:17 pm
Also, in answer to the original question, adjustment layers whose basis is dependent upon a specific condition such as color space mode can not be translated into a different color space mode when doing a mode change. The caluculations upon which the adjustments are made are color mode specific-that's why it's required to flatten when mode changing.
Title: LAB -> RGB and adjustment layers
Post by: Hermie on August 05, 2005, 02:30:35 am
> links or suggested reading

Take a look at Uwe Steinmueller's books e.g.:

"Dop 2000: Digital Photography Workflow Handbook"
see http://www.outbackphoto.com/ (http://www.outbackphoto.com/)

Herman
Title: LAB -> RGB and adjustment layers
Post by: Mark D Segal on August 08, 2005, 09:33:43 am
Dan and Michael recommended this approach for images where it worked better or more easily than trying to do the same thing in RGB mode. My reading of their books did NOT suggest it is necessarily better to use Lab for everything. Their books do describe the kinds of situations in which Lab may be a preferred mode for some adjustments. Much of Dan's stuff is also on the web (do a Google search, you'll find alot.)

This is the first I hear of Dan's new book - it will be most interesting. I attended one of his workshops at NAPP's PhotoshopWorld and found it one of the most impressive sessions of the conference. He has, of course, generated a huge controversy about the very issue of destructive effects converting back and forth between Lab and RGB. At that conference, in response to a question, he distinctly said you can do it a thousand times on the same image and you won't see any difference - suggesting that whatever the math does, it isn't visible. Of course many other serious and respectable professionals disagree with him. I haven't had either the patience or the interest or the need to sit behind my computer and make a 1000 conversions to satisfy myself on the issue and VERY seldom use Lab; but I think it useful to have in the toolbag for the occasional time when it really helps. On those images where I tested one round trip between Lab and RGB no image degradation popped out at me, but that of course doesn't mean very subtle changes didn't happen.
Title: LAB -> RGB and adjustment layers
Post by: Mark D Segal on August 08, 2005, 12:16:02 pm
Thanks Jeff, I guess that's why Dan doesn't have problems with his 1000 conversions: if the first one didn't bother him it was smooth sailing for the other 999!  

I do work in 16 bit from start to finish and seldom use Lab - certainly not for luminosity adjustments. Once and a while I find it handier for global color correction, but it is powerful and tricky to use. Meanwhile, I've placed an advance order for Dan's new book. I'm dying with curiosity to see how one fills over 350 pages with useful information about working in Lab. It will be either a pathbreaker or a storm-generator or both.

By the way - a question Jeff - when one works in Luminosity mode with one layer but not others, I believe one needs to be doubly careful about the ordering of the layers in the stack, because once the blend mode is luminosity in a lower order layer it constrains adjustments involving colors in higher order layers. Is this a valid proposition or is it a result of something I'm not doing right?
Title: LAB -> RGB and adjustment layers
Post by: PeterLange on August 13, 2005, 11:38:45 am
Quote
By the way - a question Jeff - when one works in Luminosity mode with one layer but not others, I believe one needs to be doubly careful about the ordering of the layers in the stack, because once the blend mode is luminosity in a lower order layer it constrains adjustments involving colors in higher order layers. Is this a valid proposition or is it a result of something I'm not doing right?
 
If nobody else, let me try.

Most typically, I set up three adjustment layers for tonal corrections in PS.  In the reverse order from the bottom to the top:

#1:  Levels, to adjust the whitepoint by means of the RGB highlights’ slider.  One of the very few moves which are even in line with David Dunthorn’s basic paper on color integrity in digital imaging.  There’s no side effect on color.  The basic principle is: Linear scaling / Exposure (RGB Levels' highlights) first, before any "synthetic" tonal settings are applied.
Also a shift of the Levels’ midtone slider to the left is well placed at this stage (brightening / “gamma”)

#2:  Levels, to set the blackpoint by means of the RGB shadows’ slider.  Blending mode set to Luminosity in order to minimize the complex side effect on color saturation.

#3:  Curves, to define any further tonal tweaking needed.  Toggling between Normal blending and Luminosity mode allows to select the preferred rendition on a visual basis.


All in all, the purpose of these efforts is to minimize the side effect of tonal settings on color saturation.

Peter

--
Title: LAB -> RGB and adjustment layers
Post by: digitaldog on August 09, 2005, 06:52:37 pm
Quote
The ironic part of the story is that ProPhotoRGB is even larger than CIE Lab.

Lab data get afraid when they see ProPhotoRGB, not vice versa.
Only part of ProPhoto (the blue primary) is outside the CIE chromaticity diagram. In reality, far more of LAB is stretching out the gamut of the original (the entire horseshoe plot).
Title: LAB -> RGB and adjustment layers
Post by: bjanes on August 12, 2005, 11:44:34 am
Quote
There’s a Levels calculator provided by Bruce Lindbloom on his site:
http://www.brucelindbloom.com/ (http://www.brucelindbloom.com/)

Andrew,

A very interesting link. Not many of us want to get into the calculus of the CIE equation, but the implications are easy enough to grasp. I see that to go from a gamma 1 space to gamma 2.2 space with 256 levels requires 16 bit input. The 12 bits in our raw files translates to only 249 levels in our gamma 2.2 output spaces, not the 2049 that I had imagined.

Using 16 bit in PS prevents rounding errors but we do not have nearly the number of levels that we might think. Is this true?
Title: LAB -> RGB and adjustment layers
Post by: Mark D Segal on August 12, 2005, 02:15:18 pm
My understanding is that in Photoshop we have 2^15 levels, which equals 32,768. The standard calculation for deriving the number of luminosity levels is 2 bits raised to the power of the bit depth.
Title: LAB -> RGB and adjustment layers
Post by: PeterLange on August 13, 2005, 02:42:55 pm
Quote
Hermie,

Thanks a lot for adding the link.

Just some remarks from my perspective:  David’s paper on Color Integrity was / is a milestone (!). Also I’m a little bit proud to say that I found his paper some time ago after making first steps towards similar equations.  However, David’s style is very special and the math that he utilizes may be seen as (over)complicate.  Also there’s some other stuff at his website where I clearly disagree (/ which I’ve discussed with David personally).

Peter


P.S.: What I really like with your posts is the (silent) message that customers are catching up with technology.  Probably more effective than my attitude.

--
Title: LAB -> RGB and adjustment layers
Post by: jani on August 03, 2005, 08:50:15 am
I don't know of any way to avoid this if you feel that you have to save your PSD file in RGB format.

The easiest way around it is to save the PSD file in LAB.

When you need to convert to RGB, you create a copy of the LAB file, convert, and if you think you might use the RGB file more than once, save that under a different name, for instance "rubberandsteel_RGB.psd".
Title: LAB -> RGB and adjustment layers
Post by: PeterLange on August 04, 2005, 04:15:26 am
Quote

Every tone curve in any RGB space has a side effect on color saturation - period. Severity depends on many factors and sometimes we may even appreciate it for artistic reasons.  For example, blackpoint setting (to the right) increases color saturation, mainly for the shadows with decreasing significance towards the lights.

Luminosity blending or changing to Lab-lightness (harmless at 16 bit/ch) can typically reduce such effects – but not necessarily.  For example, increasing midtone brightness by means of the Levels’-“gamma” slider induces a broad de-saturation which isn’t much buffered by those measures.

Even, pure whitepoint settings are better done in normal RGB mode. In fact, this is the only exception with no side effect on color at all. Whereas Luminosity blending or Lab-lightness would lead to a de-saturation.

HSB could be an interesting option, however, color scientists don’t like it and PS doesn’t fully support it on an active basis.

Cheers! Peter

---
Title: LAB -> RGB and adjustment layers
Post by: omwoods on August 04, 2005, 04:54:36 pm
Ok,
now that you've all shown me to be the amatuer here:

Ignoring LAB for my A-RGB files; I should perform curves as an adjustment layer, set to luminosity, but what about hue/sat? Normal blending mode? Sharpening last before print/ save as...

No detailed explanations please, just links or suggested reading; no point you sitting in front of a screen for five minutes typing out something written somewhere else... ::

Thanks again,
Oliver

p.s. digitaldog, currently browsing over your 'tips' page, another nights reading...
Title: LAB -> RGB and adjustment layers
Post by: Schewe on August 08, 2005, 11:03:32 am
Quote
On those images where I tested one round trip between Lab and RGB no image degradation popped out at me, but that of course doesn't mean very subtle changes didn't happen.
The first trip from RGB to Lab is the one that introduces the data drop-after the first trip, additional moves to and back from RGB>Lab>RGB don't do much if anything to a file.

As for exacly what happens to an RGB image that is converted to Lab, it all depends upon the colors in the image itself. The quantization errors are subtle...and as such may not show up as a problem until steps are taken to adjust the image _AFTER_ the RGB>Lab>RGB round trip.

If you are doing the conversions in 16 bit space, the quantization errors are less likely to introduce data loss that can lead to problems. That said, like anything else in Photoshop, the less erros you introduce into an image, the better the image integrety will be maintained. Thus, converting from RGB to Lab for the purpose of allpying a luminance based curves adjustment is foolish because essentially the same adjustment can be made in RGB using the curves layer in luminosity bland mode.
Title: LAB -> RGB and adjustment layers
Post by: bjanes on August 12, 2005, 07:24:29 am
Quote
The amount of data loss depends on the original gamut size and gamma of the working space. For example, if the working space is Adobe RGB, which has 256 values available, converting to 8-bit LAB reduces the data down to 234 values. The net result is a loss of 22 levels. Doing the same conversions from ProPhoto RGB reduces the data to only 225 values, producing a loss of 31 levels.

Rodney, those are interesting figures but could you explain the math behind the loss of exactly 22 and 31 levels? It might be instructive.
Title: LAB -> RGB and adjustment layers
Post by: digitaldog on August 12, 2005, 09:07:53 am
There’s a Levels calculator provided by Bruce Lindbloom on his site:
http://www.brucelindbloom.com/ (http://www.brucelindbloom.com/)
Title: LAB -> RGB and adjustment layers
Post by: digitaldog on August 12, 2005, 02:23:01 pm
Quote
My understanding is that in Photoshop we have 2^15 levels, which equals 32,768. The standard calculation for deriving the number of luminosity levels is 2 bits raised to the power of the bit depth.
Correct.

The high-bit representation in Photoshop has always been "15   1" bits
(32767 (which is the total number of values that can be represented by 15 bits of precision)   1).  This requires 16 bits of data to represent is
called "16 bit".