RetouchPRO

Go Back   RetouchPRO > Technique > Photo Retouching
Register Blogs FAQ Site Nav Search Today's Posts Mark Forums Read Chat Room


Photo Retouching "Improving" photos, post-production, correction, etc.

Reply
 
Thread Tools
  #1  
Old 06-08-2011, 06:30 AM
ISO ISO is offline
Junior Member
 
Join Date: May 2008
Posts: 9
how to separate colour and luminance from RGB

Hello friends

I want help (detailled tutorial) for separating colour and luminance from RGB.

Thanks in advance.

Regards

Mukund
Reply With Quote
  #2  
Old 06-08-2011, 07:08 AM
Der_W's Avatar
Senior Member
 
Join Date: Jul 2009
Location: Germany
Posts: 528
Re: how to separate colour and luminance from RGB

The easiest way would be to simply use the "Luminosity" and "Color" blending modes, so your adjustments will just affect the components you told it to.

If you want to extract the luminosity, one easy way would be to add a new layer in "Color" mode and fill it with 50% gray.
If you want to extract the color, add a new layer in "Luminosity" mode and fill it with 50% gray.

Other methods using Apply Image or the Channel Mixer would work as well, but are probably overkill.
Reply With Quote
  #3  
Old 06-08-2011, 07:16 AM
John Wheeler's Avatar
Senior Member
Patron
 
Join Date: May 2011
Location: Colorado
Posts: 414
Re: how to separate colour and luminance from RGB

Hi Mukund
ADDED EDIT: Jonas beat me to it while I was typing
Kind of depends on your definition of luminance and colour. Photoshop is not consistent in how it is used throughout their software offerings including not totally consistent within Photoshop itself.

Here is a link to a overall reference document that covers many math details of what Adobe does from a math standpoint in much of their software. Blends start on page 320 and near page 326 is where they get into the details of their Luminosity, Color, Hue,Sat blend modes which reveals their definitions through the equations. Note that their definition of Saturation does not match how the numbers for saturation is used in their Color Pickers:

http://wwwimages.adobe.com/www.adobe...32000_2008.pdf

That may be more than what you want. So it may help for you to be more specific on what you are trying to achieve to get more specific answers.

Here are some basic techniques to extract Luminance and Hue

1) To extract Luminance.
- Lower layer is image
- Next higher layer is a neutral tone layer (white, black, or any shade of gray). Set the Blend mode of this neutral tone layer to "Color". The resulting image is the Luminance where all RGB values are equal where the Luminance is defined by L= .3R + .59G + .11 B

2) To extract Hue
- Lower Layer is solid 50% gray
- Next Layer up is your image. Set the Blend mode of your image layer to Color. The resulting image will be an image where the Luminosity is 50% for all pixels yet all the pixels will have the exact Hue of you original Image. The blend will try and keep the Saturation yet will give precedence to the Luminosity first. Note: There are other techniques depending on what you want to do.

I think I will stop there because what you need is really dependent on what you want to do. Provide more details on what you are trying to do and forum members could provide more specific answers. Hope this gives you a start.
Reply With Quote
  #4  
Old 06-09-2011, 01:23 AM
ISO ISO is offline
Junior Member
 
Join Date: May 2008
Posts: 9
Re: how to separate colour and luminance from RGB

Thanks Jonas and John. Its kind of you to give reply in detail.

Actually what I want is this

http://img135.imageshack.us/i/curveslayer.jpg/

Could you pl. share detail tutorila how to do this?

Thanks again.

Regards,

Mukund

Last edited by ISO; 06-09-2011 at 01:37 AM.
Reply With Quote
  #5  
Old 06-09-2011, 04:20 AM
Chain's Avatar
Senior Member
 
Join Date: May 2009
Location: Oslo, Norway
Posts: 482
Re: how to separate colour and luminance from RGB

Quote:
Originally Posted by ISO View Post
What Jonas said would let you do this (The Lum/Color layers, not the RGB layers).

Here are more detailed steps:
1. Make a copy of the original image layer, set it to "Color" blend mode.
2. Create a layer with 50% gray below it.
3. Merge the two layers. You now have a layer with the color information.
--
4. Make a copy of the original image layer, set it to "Luminosity" blend mode.
5. Create a layer with (any shade of) gray below it.
6. Merge the two layers. You now have a layer with the luminosity.

If you have the Color layer on top, set the blending of it to "Color".
If you have the Luminosity layer on top, set the blending mode of it to "Luminosity"
(The layer with the original image can safely be hidden/removed).

If you do this regularly, you should record the steps as an action.

Note: Usually there is no need to create a separate layers for Lum. and Color. It's usually easier and more efficient to do simply add Lum./Color blending mode to whatever corrections you do to the image (as layers).
Reply With Quote
  #6  
Old 06-09-2011, 05:05 AM
Senior Member
 
Join Date: Jul 2004
Location: Brooklyn
Posts: 431
Re: how to separate colour and luminance from RGB

Quote:
Originally Posted by ISO View Post
Thanks Jonas and John. Its kind of you to give reply in detail.

Actually what I want is this

http://img135.imageshack.us/i/curveslayer.jpg/

Could you pl. share detail tutorila how to do this?

Thanks again.

Regards,

Mukund
What is it that we are looking at? Explain what the starting point is, what the desired end result is. Several processes described here are what would normally be thought of as accomplishing what you asked about. The image you linked to would seem to have nothing to do with any of those procedures.
Reply With Quote
  #7  
Old 06-09-2011, 06:28 AM
Chain's Avatar
Senior Member
 
Join Date: May 2009
Location: Oslo, Norway
Posts: 482
Re: how to separate colour and luminance from RGB

Quote:
Originally Posted by edgework View Post
What is it that we are looking at? Explain what the starting point is, what the desired end result is. Several processes described here are what would normally be thought of as accomplishing what you asked about. The image you linked to would seem to have nothing to do with any of those procedures.
To me the picture was relevant, although the RGB layers at the bottom might make it confusing as they do not contribute to anything.
From what I can tell we are looking at an image where at the bottom we have the RGB channels converted to separate layers (screen blend mode). Above that we have the same image separated as Luminosity+Color instead (overriding the below layers).

Edit: Attached is a much better example showing what we are doing.
Attached Images
File Type: png lum&color-layers.png (44.0 KB, 107 views)
Reply With Quote
  #8  
Old 06-09-2011, 09:21 AM
ISO ISO is offline
Junior Member
 
Join Date: May 2008
Posts: 9
Re: how to separate colour and luminance from RGB

Thanks again friends. Attached image is what lobster droplet from free gamma is doing.

It splits rgb image in to separate colour component and luminocity. This divide gives very powerful editing options like dodge and burn and selective colour adjustments.

Pl. Share detailed steps how to do this.
Reply With Quote
  #9  
Old 06-09-2011, 09:37 AM
Senior Member
 
Join Date: May 2008
Posts: 322
Re: how to separate colour and luminance from RGB

so cool anyone have an action lmao yes i am that lazy >.>.....
Reply With Quote
  #10  
Old 06-09-2011, 11:41 AM
lurch's Avatar
Senior Member
Patron
 
Join Date: Jul 2006
Location: SoCal
Posts: 523
Re: how to separate colour and luminance from RGB

If you convert the image to Lab, it's done for you. And you can make a smart object from an RGB image, then convert the SO to Lab without affecting the RGBness of the original image. Or am I missing the point?
Reply With Quote
  #11  
Old 06-09-2011, 11:54 AM
ISO ISO is offline
Junior Member
 
Join Date: May 2008
Posts: 9
Re: how to separate colour and luminance from RGB

Edit- friends because of your valuable information im successful in achieving what i want. Its working.

Thanks again.
Reply With Quote
  #12  
Old 06-09-2011, 11:55 AM
Chain's Avatar
Senior Member
 
Join Date: May 2009
Location: Oslo, Norway
Posts: 482
Re: how to separate colour and luminance from RGB

Quote:
Originally Posted by ISO View Post
Pl. Share detailed steps how to do this.
I already did back in this post:
http://www.retouchpro.com/forums/pho...tml#post292588
Reply With Quote
  #13  
Old 06-09-2011, 12:20 PM
Chain's Avatar
Senior Member
 
Join Date: May 2009
Location: Oslo, Norway
Posts: 482
Arrow Re: how to separate colour and luminance from RGB

Quote:
Originally Posted by lurch View Post
If you convert the image to Lab, it's done for you. And you can make a smart object from an RGB image, then convert the SO to Lab without affecting the RGBness of the original image. Or am I missing the point?
With LAB it means you have to will have to convert color spaces. Beware that in 8-bit there is always some loss from this, and unless you go via Convert to Profile it will add more noise/dithering in the process. This is not a visible problem if working in 16-bit.
In the conversion you will loose all layers, and you have much more limited tools in LAB.
You can get just as good results using Luminosity and Color blending modes.

You could stamp a copy of the image, convert it to a smart object, open the smart object, work directly on one of the channels instead of working in layers, save and then jump back out of the smart object to see the result with the rest of the layers... I find this cumbersome compared to simply doing the adjustment on a new layer and change the blending mode.

I strongly believe that there is never a need to go through all this to work on color and luminosity separately. You gain nothing (at worst you loose flexibility and add extra noise). It is quick and simple in RGB.

----

I have attached an action for you that does the Color/Luminosity separation as layers. I included some frequency separation actions and sharpening actions as well just to make the set more useful... :=)

The actions should run well even on layered documents and foreign language versions of Photoshop (report back if they don't).
Attached Files
File Type: zip Separations.zip (1.9 KB, 44 views)
Reply With Quote
  #14  
Old 06-09-2011, 12:29 PM
John Wheeler's Avatar
Senior Member
Patron
 
Join Date: May 2011
Location: Colorado
Posts: 414
Re: how to separate colour and luminance from RGB

Hi Mukund
Jonas, Chain, and I are all saying the same thing and it is exactly what they are also doing in Lobster droplet. Here is a specific layers stack showing how this is achieved with to make it more explicit using the same colors in your example:

Screen shot 2011-06-09 at 12.14.45 PM.png

Lets look at top three layers first

- Original File
- On top of that is neutral tone layer (black, white, any shade of gray) with Blend set to Color
- Resulting image is the luminosity which is stamped to the top layer to make it visible in the stack.

Lets Look at the bottom three layers
- Original File
- On top of that is a 50% gray layer with Blend set to Luminosity
- The resulting image are the colors of the image at Luminosity 50%. That is stamped to the next layer so you can see it in the Layer Stack and I named it "Color"

Now to separate out the 3 color channels (there are many ways to do this)
- Above the "Color" layer I put a Curves Adj Layer
- Turn down the Green and Blue Curves to Zero (flat at bottom). This yields the Red Channel. I stamped it to make it visible in Layer Stack
- To get Green channel repeat with Curves Adj turning off Red and Blue channel. Then stamp it
- To get Blue channel repeat with Curves Adj turning off Red and Blue channel. Then stamp it

That is all there is to it (and no I did not make an action)

EDIT - Lots of other inputs since I started typing - wow
Reply With Quote
  #15  
Old 06-09-2011, 01:16 PM
Senior Member
 
Join Date: May 2008
Posts: 322
Re: how to separate colour and luminance from RGB

Quote:
Originally Posted by Chain View Post
With LAB it means you have to will have to convert color spaces. Beware that in 8-bit there is always some loss from this, and unless you go via Convert to Profile it will add more noise/dithering in the process. This is not a visible problem if working in 16-bit.
In the conversion you will loose all layers, and you have much more limited tools in LAB.
You can get just as good results using Luminosity and Color blending modes.

You could stamp a copy of the image, convert it to a smart object, open the smart object, work directly on one of the channels instead of working in layers, save and then jump back out of the smart object to see the result with the rest of the layers... I find this cumbersome compared to simply doing the adjustment on a new layer and change the blending mode.

I strongly believe that there is never a need to go through all this to work on color and luminosity separately. You gain nothing (at worst you loose flexibility and add extra noise). It is quick and simple in RGB.

----

I have attached an action for you that does the Color/Luminosity separation as layers. I included some frequency separation actions and sharpening actions as well just to make the set more useful... :=)

The actions should run well even on layered documents and foreign language versions of Photoshop (report back if they don't).
Dude you rock Christmas came early this year thanks again!!!!
Reply With Quote
  #16  
Old 06-09-2011, 01:18 PM
lurch's Avatar
Senior Member
Patron
 
Join Date: Jul 2006
Location: SoCal
Posts: 523
Re: how to separate colour and luminance from RGB

@chain - I think you will find that there is essentially no loss in converting to Lab. But what you find convenient in your workflow is whatever you find convenient. Have to admit that I rarely use Lab any more, because when I have to separate luminosity and color (especially in restoration work), it's with luminosity and color layers.
Reply With Quote
  #17  
Old 06-09-2011, 01:18 PM
Tony W's Avatar
Senior Member
Patron
 
Join Date: Mar 2010
Posts: 717
Re: how to separate colour and luminance from RGB

Quote:
Originally Posted by Chain View Post
With LAB it means you have to will have to convert color spaces. Beware that in 8-bit there is always some loss from this, and unless you go via Convert to Profile it will add more noise/dithering in the process.
While I can see that some conversions between colour spaces can be harmful I have not really experienced issues (yet!) with converting to LAB either 8 bit or 16 bit and converting back again to RGB. Or at least I have not noticed any that had a detrimental effect on the final image!!

What kind of losses can you expect and how much will be observable in a real world image? Do you have any examples (or links) that illustrate the issues?
Reply With Quote
  #18  
Old 06-09-2011, 01:46 PM
John Wheeler's Avatar
Senior Member
Patron
 
Join Date: May 2011
Location: Colorado
Posts: 414
Re: how to separate colour and luminance from RGB

Hi Tony
I have seen issues in 8 bit going back and forth to Lab and why I suggest staying in 16 bit for that operation. It can be demonstrated very easily.

Here is a 256px x 256px image with all 256 gray levels represented one per pixel column (100% view):

Screen shot 2011-06-09 at 1.37.30 PM.png

If you have in Edit > Color Settings the dither turned off, if you take this to Lab and back and do the difference, and just amplify the differences (i.e. anything other than a perfect match is pegged to 255) here is the image you see:

Screen shot 2011-06-09 at 1.37.49 PM.png

If you do the same experiment and and have the Color Setting mode so the dither is "on", then here is why you get:

Screen shot 2011-06-09 at 1.38.11 PM.png

The differences are only 1 bit differences however it does make a difference. With dither turned off, in slowly changing colors such as skies, the changes can jump two bits instead of 1 bit and this causes increased noticeable banding (let me know if you want me to post an image)

With dither turned on, you don't notice the banding yet you end up with noticeable 1 bit mottling (again I can post an image if desired).

So I agree with chain, conversion between some color spaces will create artifacts in your image that can be noticeable.
Reply With Quote
  #19  
Old 06-09-2011, 01:47 PM
Chain's Avatar
Senior Member
 
Join Date: May 2009
Location: Oslo, Norway
Posts: 482
Re: how to separate colour and luminance from RGB

Quote:
Originally Posted by John Wheeler View Post
- Turn down the Green and Blue Curves to Zero (flat at bottom). This yields the Red Channel. I stamped it to make it visible in Layer Stack
Ah, that's a nice way to turn the layers into channels. I didn't think of that.
Only time I've really needed to turn channels into layers was when I was making some 2-strip Technicolor actions. I will keep it in mind next time.

Last edited by Chain; 06-09-2011 at 01:51 PM. Reason: Minor clarification.
Reply With Quote
  #20  
Old 06-09-2011, 01:50 PM
John Wheeler's Avatar
Senior Member
Patron
 
Join Date: May 2011
Location: Colorado
Posts: 414
Re: how to separate colour and luminance from RGB

Hi Chain
Another easy way to get the Channels into Layers is with the Channel Mixer
Adjustment Layer. You just leave the channels you don't want with all mixer values set to zero. Works like a charm.
Reply With Quote
  #21  
Old 06-09-2011, 02:31 PM
Tony W's Avatar
Senior Member
Patron
 
Join Date: Mar 2010
Posts: 717
Re: how to separate colour and luminance from RGB

Hi John,
Thanks for the examples and your explanation. From my own limited experiments I have not experienced any banding converting from RGB to LAB and back again to RGB. Therefore I am having difficulty accepting that this is a real problem.

I have seen banding issues when I foolishly decided to edit 8 bit jpegs in ProPhoto .

I am not surprised though that your examples of a computer generated gradient exhibits problems - although I am at a loss to explain it technically, I accept that this can happen and therefore such images should only be made in the final output space RGB or CMYK.

So I have to say that so far as I have not experienced issues converting to LAB and back and the fact that Dan Margulis experiments seem to back this up, I am yet to be convinced that there is a real problem that would seriously degrade many images.
Of course I reserve the right to change my mind in the future should my new experiences prove these thoughts flawed
Reply With Quote
  #22  
Old 06-09-2011, 07:11 PM
John Wheeler's Avatar
Senior Member
Patron
 
Join Date: May 2011
Location: Colorado
Posts: 414
Re: how to separate colour and luminance from RGB

Hi Tony
Your approach/thinking is not flawed. Independent of technical specs, actual experience is much more powerful. The effect I am talking about is not large and usually only comes up when you have very low noise images (noise in the image masks the effect).

What I did to provide a more real life example is to show a sunset with a very low noise background where the color shifts from yellow sun to darker oranges as you move out. This is an RGB image.
Sunset at 800px.jpg

What I did was duplicate this layer; made duplicate Layer a Smart Object; went into the Smart Object and changed it to Lab mode; Saved Smart Object; Clicked back to original Layer Stack; Smart Object goes back to RGB mode in original stack; Mask to reveal only right hand side of Smart Object so left hand side is original RGB image. Here is the image at 200%. The banding is subtle yet is there - higher for going to Lab and back:

Screen shot 2011-06-09 at 6.41.13 PM.png

Depending on monitor this can be hard to see so increasing the contrast and brightness the comparison becomes more clear with smoother step gradient on the left original image and not as even for going to Lab and Back on the right.

Screen shot 2011-06-09 at 6.41.52 PM.png

Now if the image already had some noise or you add some noise/dither afterwards, this does not become noticeable.

What is interesting you mentioned editing an 8 bit sRGB image in ProPhoto. Turns out, taking this 8 bit sRGB image to Lab and back has a very similar effect. All of the colors in most images only occupy a very small fraction of the A and B Lab channels (the A and B channel are both represented by 8 bit values). Therefore the color component/channels that were spread out over a larger number of RGB bits are compressed down into a smaller number of A and B channel bits (check you typical image and see what range of A and B are actually used - it is relatively small compare to the entire Lab range). When you go from Lab back to sRGB that compression comes back as a very small amount of color posterization/banding.

So even though it is subtle, so are the differences in many things we do in our the workflow. All added up, each of those subtle differences can make a difference. So I just use the general rule of thumb to stay in 16 bit until the very end to avoid such issues. Hope that brings the discussion back from the technical (I have a tendency to do that ) to a more real life example.

Image leveraged from stock exchange - modified for use in this example http://www.sxc.hu/photo/1347672
Reply With Quote
  #23  
Old 06-09-2011, 11:57 PM
ISO ISO is offline
Junior Member
 
Join Date: May 2008
Posts: 9
Re: how to separate colour and luminance from RGB

Hi John

Thanks for sharing your way of doing it. Now next thing is I'm going to test this setup for the examples given in the lobster documentation. If the results are identical then we are successful.

If there is deviation I will report back.

Regards,

Mukund
Reply With Quote
  #24  
Old 06-10-2011, 02:43 AM
Tony W's Avatar
Senior Member
Patron
 
Join Date: Mar 2010
Posts: 717
Re: how to separate colour and luminance from RGB

John, many thanks for going to the trouble of finding an example of the effect.

For me I think your early statement "Independent of technical specs, actual experience is much more powerful" really nailed it! Thinking back to where I have used LAB there are generally two scenarios a. working with my own digital files from camera or scanner - always in 16 bit and b. forcing colour apart in poor images for restoration. So rarely do I work in 8 bit unless I have to.

Your images clearly indicate the potential problem and one that I experienced when I decided to edit 8 bit in ProPhoto albeit with blue sky. So it does look like 8 bit RGB to LAB moves and 8 bit editing in 16 bit work space are open to this type of effect and therefore should generally be avoided.

As you say the problem may be small but further work can/will compound the effect
Reply With Quote
  #25  
Old 06-21-2011, 12:08 PM
Junior Member
 
Join Date: Feb 2009
Posts: 18
Re: how to separate colour and luminance from RGB

I feel like I'm jumping into the color & luminance separation topic a little too late.

I understand how to do the separation but my question is... why? Why would you do this and how would you use it?

Please enlighten?

Thanks... David
Reply With Quote
  #26  
Old 06-21-2011, 01:08 PM
Chain's Avatar
Senior Member
 
Join Date: May 2009
Location: Oslo, Norway
Posts: 482
Re: how to separate colour and luminance from RGB

Using the Color/Luminosity blend modes, or separating the image like discussed, you can:

* Edit the Luminosity ("brightness") without affecting the color (hue+saturation).
* Edit the Color without changing the Luminosity.

This can be useful on many occasions when retouching an image. One example is if you want to change the color of an object without making it brighter or darker, or if you wanted to even out skin color without affecting the Luminosity/brightness of the skin.
There are many other applications as well (only limited by the imagination of the retoucher I guess).

Ps: I recommend learning how to use the blending modes first before you consider if separating the image (or even converting to Lab) would provide you with a more useful workflow.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Home Use for CMYK Separations Jeff F Hidden Power Support 7 06-03-2003 10:45 AM
aerial photo flight1 Image Help 9 04-06-2003 01:40 PM


All times are GMT -6. The time now is 06:46 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2
Copyright © 2008 Doug Nelson. All Rights Reserved