Photoshop LAB color: Chapter 14: "Once for Color, Once for Contrast"

jfriendjfriend Scripting dude-volunteerPosts: 24,828Registered Users Major grins
edited January 30, 2006 in Finishing School
Chapter 14 summary

The title of this chapter is “Once for color, once for contrast”. While Margulis does describe some techniques for manipulating color or contrast in RGB, what I really think this chapter should be called is “When to use RGB instead of LAB” or “When to use RGB before you go to LAB”.

What the phrase “once for color, once for contrast” means is that you can work on the color and the contrast of your image completely separately and then combine the two to make your final image. In the chapters up until now, we’ve already been doing just that in LAB mode because the L channel is for contrast and the A/B channels are for color. But, adding to that, Margulis now discusses a number of techniques for enhancing either color or contrast in RGB mode. These can then be used with blend modes or LAB mode to make contrast or color changes that are either not possible in LAB mode alone or are way too difficult in LAB mode.

So, if color and contrast are already separated in LAB mode, why would it ever be easier to work on them in RGB mode? There are a number of different reasons why RGB is sometimes a better place to work. Here are five of the reasons that Margulis describes for sometimes working in RGB first:
  • When a particular RGB channel shows a lot of desired contrast
  • When steepening the L channel isn’t the best way to improve contrast
  • When color corrections need to vary with luminosity
  • Tweaking a color channel directly
  • Blending color channels to remove a cast
Let’s examine each technique.

When a Particular RGB Channel Shows a Lot of Contrast

There are some kinds of images where one of the RGB channels contains a lot of contrast. The most classic example of this is a blue sky with clouds. In this case, the red channel will nearly always contain great contrast for the sky. So, using that high contrast channel with a useful blend mode will allow one to greatly increase the contrast in the sky. If you think of an image as having ten channels (R,G,B plus L,A,B plus C,M,Y and K), when you have a channel in any mode that exhibits great contrast in a place where you want to enhance contrast, you should use it in that mode first, then convert to LAB for other treatments on the image.

Here’s why the red channel works well for blue skies. Blue skies have almost no red in them, but white clouds must have a lot of red in order to be white. So, the red channel will be black where the sky is blue and white where there are clouds – high contrast. When a blue sky isn’t perfectly blue, it tends to be in the cyan direction. But cyan is the opposite of red so even when it heads in the cyan direction, there’s still not much red in the sky.

The blue channel will be nearly all white because where the sky is mostly blue, you will have a lot of blue (making the blue channel white) and where the clouds are bright white, the blue channel will again be white so the whole blue channel will be nearly white.

The green channel will be decent contrast if the sky is really blue, but it’s contrast will fall off as the sky gets more cyan and thus contains more green. For normal color skies, the green channel isn’t as good as the red channel, though it’s usually better than the blue channel.

So, the red channel is nearly always great for enhancing blue skies with clouds. And, once you move to LAB, all that great contrast information is often lost. So, we want to use the red channel while we’re in RGB before moving the LAB for other corrections.

The green channel is often used to enhance contrast in people’s faces in the same way.

Note that this technique is not just for RGB mode. The general case of this technique says to think of an image as having 10 channels (RGB, LAB, CMYK) and any one of these channels that happens to have high contrast in an area of interest can be used with a blend mode to enhance the image contrast.

Here’s an example of this technique in action. This is an image taken by John Crae and posted by his son in the Photoshop Shenanigans forum (permission granted for use here).



53690740-M.jpg

When I saw this image, I thought it would benefit from some enhanced blue contrast in the sky. So, I glanced at the three channels for this image. Here’s what they looked like (in order Red, Green, Blue):

53690749-S.jpg53690685-S.jpg53690658-S.jpg




In order, you can see that the red channel has the most contrast in the sky, the green not quite as much and the blue almost none. So, I copy the red channel and paste it in as a new layer above the original image. By default, that will just show us a copy of the red channel in black and white. To make it do something useful, we need to change the blend mode. Margulis suggests using the luminosity blend mode (which is essentially replacing the luminosity for the image with the red channel) or sometimes a combination of the darken blend mode and the luminosity blend mode (when you just want the red channel to apply where it is darker than the original). Using the luminosity blend mode give us this result below which definitely enhances the sky, but it also changes the rest of the image in ways that we aren’t all that interested in. Because there’s a fair amount of red in the rest of the image, the luminosity has been affected in many places other than just the sky.



53690703-M.jpg



At this point, we have several different options to confine the change to just the sky. The most common technique is probably to make a mask for just the sky, but there’s a much easier way for this image. Since what we’re trying to do in this image is deepen the blues in the sky and there’s really no other solid blue in the image, we can probably use some blend-if settings to isolate the change to only affect the blue tones in the image. I open the blend-if dialog on the red channel layer and set it to this:


53690730-M.jpg


which blocks the layer blend for anything except a specific range of blue tones underneath. That isolates the effect to just the sky and we now have this result which restores the non-sky tones to what they were before:

53690725-M.jpg
This is definitely a deeper blue sky from what we had originally, but there are some blend modes that might produce an even more dramatic effect. For that, I try the color burn blend mode instead of luminosity. It produces this deeper blue sky:
53690673-M.jpg


Not related specifically to this chapter in the book, but using the HIRALOAM technique from elsewhere in the book, the contrast is enhanced even further to this:
53690623-M.jpg



Another way that Margulis describes to do this is using a combination of the darken mode and the luminosity mode. In a nutshell, he uses Apply Image to apply a copy of the red channel in darken mode to a duplicate layer. This will make the image gray anywhere the red channel is darker than the composite image. He then changes the blend mode of the duplicate layer to luminosity to make the change only affect the luminosity where the red channel is darker. In the image we have here, that pretty much only happens in the blue part of the sky. Let’s look at each step in this process:

Here’s the Apply Image dialog. The source of the Apply Image is the red channel from the background layer. The destination is the duplicate copy of the background layer with the darken blend mode.

53962367-M.jpg


The Apply Image command produces this result below. What you see is that the image has become a darker gray wherever the red channel was darker than the composite image. Because our “target” in the Apply Image dialog was the whole composite image, the Apply Image command replaced all three channels in the composite image (R, G and B) with the red channel in places where the red was darker than the combined composite. That makes the image a darker gray in places where the red channel was dark and the result looks like this:

53962243-M.jpg


Now, since this isn’t the actual result we want (we don’t want gray), he changes the blend mode on this duplicate layer to luminosity to preserve the color from the original and just darken the luminosity in the right places. In this way, he gets the effect of both blend modes (darken and luminosity). The Apply Image command with the darken blend mode applies the red channel, only where it’s darker and the luminosity blend on the duplicate layer makes the darkening change only apply to luminosity, not color. That gives us this result.

53962253-M.jpg


In this particular image, the blue sky is indeed darker but it’s not nearly as deep a blue as the earlier method using the color burn blend mode. As always, which derivative of this technique works best is image-specific. In other images where I’ve tried color burn, it’s way, way overkill and a straight luminosity blend (without using darken or color burn) is fine or the darken method work well. It all depends on your image. Sometimes you also have to dial-back the effect on the duplicate layer by reducing the opacity if the effect is too strong. You can also repeat the process more than once if the effect isn’t enough.

When you can use this technique is very image-specific, both in terms of what you want to enhance and in what opportunity the channels provide for enhancing that aspect. Margulis suggests using this to enhnace the contrast in skies (nearly always the red channel for this) and he also suggests using this technique to enhance contrast in portrait faces (usually the green channel). If you’re looking to enhance the contrast in any area of an image, look at all three RGB channels and see if any of the channels provide good contrast in that area. If so, paste that channel into a layer and use blend modes (or use Apply Image to a dup layer with blend modes) to take advantage of that channel contrast. With a little more work (converting to other image modes), you can use the same technique on basically any of the 10 virtual channels an image has (RGB, CMYK, LAB). There are times when non-RGB channels might even be the best choices.


When Steepening the L channel Isn’t the Best Way to Improve Contrast

The Luminosity channel is a blended average of the R, G and B channels (approx. 60% green, 30% red, 10% blue) which is then shifted toward the lighter tones, expanding the shadows and compressing the highlights. When you want to add contrast to a particular part of an image in LAB mode, you are usually looking for a way to steepen the luminosity curve in the area of interest (this spreads out the tones in that area and adds perceived contrast) and flatten the curve in other areas of less interest (squishing the tones in those areas and reducing contrast). For many images, this “averaging” causes lights and darks in the different RGB channels to get averaged in the L channel and lots of the image is pushed to the mid-tones because of this averaging. This then makes it easy to steepen the mid-tones with an L channel curve and add contrast to lots of the image.

But, for other images, such as images where you are trying to add contrast to shadows or to highlights or where this “averaging” of the R,G and B channels doesn’t happen to your advantage, there may be no good spot in the L channel to steepen or you may not be able to effectively target the area of interest in the averaged L channel. This is sometimes because the way the three color channels are averaged to make the luminosity channel in LAB spreads out the areas of interest across the whole curve rather than concentrating them in one spot that you can easily steepen and sometimes your area of interest is already nicely concentrated in one of the RGB curves and the average of the Luminosity channel just dilutes the area of interest. In this case, Margulis suggests steepening the relevant R, G and B curves separately (get the most important parts of the curve to have maximum contrast in each separate color channel). While doing so, you must completely ignore what happens to color when doing this because wacky things will likely happen to color. Then, when you have maximized the contrast in each channel, you can then take that resulting image and use it as your new L channel in LAB mode. You will thus have maximized image contrast without affecting color.

Margulis suggests this guideline. If your work features bright, pure colors, add contrast using an L channel curve. If your work has mostly dull colors and you want to bring out detail, use RGB curves to expand the contrast detail, use that as your L channel, then use LAB mode to enhance the color in those dull colors.

I fully understand how separately steepening the individual R, G and B channels and then using that resulting image as a new L channel is a clever idea and should be useful in some circumstances. But, after searching through hundreds of my own images for a great example of this, I could not find one. In every case I tried, I could achieve just as good a result (many times even better), but steepening the L channel rather than the R, G and B channels and then using the result as a new L channel. The concept is cool and it does work. I just couldn’t find any of my own images where it worked better or easier than just operating on the L channel directly. In fact, this whole exercise in trying to find a good image to illustrate this technique (which I spent parts of four days looking for one), has convinced me even more of the power of enhancing contrast by steepening an appopriate part of the L channel. It’s a wonderful tool and can work magic on dull pieces of an image. Just to show you that it can work, here’s a before and after where I manipulated the R, G and B curves in RGB mode to maximize contrast in the water, then converted to LAB mode and took the resulting L channel and pasted it into a fresh copy of the image in LAB mode (did an L channel replacement). In this particular image, I also had to confine the extreme luminosity change to the water to only apply to the water using blendif settings and a partial mask. The before and after is below. Look at the texture of the water to see how much detail was raised from the water by just steepening each of the R, G and B curves where there was detail in the water. This just spread out the luminosity in each of the separate color channels to add visibility to the detail that was already in the image.


53984680-M.jpg53984639-M.jpg

Edit: A step-by-step description of using RGB curves and and L-channel replacement on this image to separate contrast from color are now described [URL="http://www.dgrin.com/showthread.php?p=238350#post238350"]here later in this thread[/URL]


When Color Corrections Need to Vary with Luminosity

There are some images that need different color corrections in shadows, mid-tones and highlights. This could be due to difficult lighting or some other environmental circumstance. Without resorting to masks and other complications, LAB mode has so perfectly separated color from luminosity that it’s very difficult to make a color correction that’s different at different luminosities. RGB, on the other hand, makes it trivially easy to change color differently at different luminosities. So, if your image needs different color correction at different luminosities, it’s usually easier to first apply some of that correction in RGB mode before moving to LAB for other enhancements.

Margulis uses an example in this chapter where much of his image has a yellow cast, but the clouds have a different cast. If he applied a uniform color correction to remove the yellow cast, he would affect the clouds in a way that would add a color cast to them that didn’t previously exist and he wouldn’t be correcting the color cast that they had. This is where RGB curves come in real handy. Since you can create any color correction you want with some combination of a RGB curves and you can control how much of that correction is applied to different tones by modifying the shape of the RGB curve, this gives you all the tools you could possibly need.

In practice, I usually do this by attempting to find three good neutral sample points in an image, one shadow, one mid-tone and one highlight. You won’t be able to find all three in every image, but if you can the work is definitely easier. If all three samples points are off in the same direction, then a simple global correction can usually fix it. But, if the highlights, shadows and mid-tones are not off in the same direction or by similar amounts, then you will need a differing amount of color correction at different tonal levels.

Here’s a fairly simple example. This is not an extreme example, but it’s illustrative of how you can use the flexibility of RGB curves to make these types of color corrections much easier than you could do the same in LAB mode.

This is from a thread in the retouching forum at dpreview.com. The image in question was posted by Jay who gave me permission to reference it here.

He started with this image that had a color cast due to the mixed lighting in the room:
51225765-L.jpg



He wanted to know how to best remove the color cast. You can read all the detail in the actual thread, but I found three sample points that looked like they should probably be neutral, one on the paper on the desk (a highlight-tone), one on the badge (a mid-tone) and one in the lady’s hair (a shadow-tone). The paper was 230,249,229, the badge was 150,165,134 and the hair was 10,9,5. All the points were not off in the same direction and were not off by equal amounts. That means we need a different color correction for highlights than shadows, than mid-tones. This would be quite difficult in LAB since color is completely independent of luminosity, but is easy in RGB mode. In this case, I decide to boost the red and blue to match the elevated green, but do it in such a way that it made a bigger difference at the brightest tones. After doing that, I got the highlights balanced, but the mid-tones were still off with not quite enough blue. So, I then pulled up the blue curve in the middle just a little bit to balance the mid-points. Then, after that change the shadows were pretty close and I was done. In the end, I had these two curves:
51224205-M.jpg51224935-M.jpg




And got this result:
51222594-L.jpg


A little shadow/highlights and slight luminosity curve to enhance contrast gave this final result:
51225749-L.jpg


Continued in next posting due to length restrictions
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question

Comments

  • jfriendjfriend Scripting dude-volunteer Posts: 24,828Registered Users Major grins
    edited January 26, 2006
    Chapter 14 summary: (cont'd)
    Continued from previous post due to length restrictions

    Tweaking a Channel with the Channel Mixer

    In a section above, we talked about using one of the existing channels directly to add contrast and affect luminosity. Sometimes rather than pulling a whole channel out and using it directly, the image can benefit from just modifying one of the existing channels to enhance our image. This is easiest to use when we have a section of an image that is dominated by one particular color that is close to R, G or B.

    Margulis illustrates an image of a tropical island where the trees on the island appear more yellow and less green than most people like to see, but the image itself does not have a color cast so he can’t just add green or remove yellow from the overall image. Instead, he uses the channel mixer in a fairly novel way to modify the green channel directly. To do so, he brings up the channel mixer, selects the green channel. By default, the green channel consists of 100% green, 0% red and 0%blue. He puts in 130% for green and -30% for blue. What he’s effectively doing is multiplying the green channel by 1.3 and then reducing it by 30% of the corresponding blue channel value for each pixel. Because he’s adding as much as he’s taking out, neutral items in the picture (those where R=G=B, will add 30% and then remove 30% to the green channel and thus both remain neutral and keep the same luminosity. Margulis suggests using this trick for lots of shots with foliage in them. It’s actually very easy. I tried it on one of my images.

    Here’s the original with no post processing next to a version with +126% green and -26% blue in the green channel. I went for a subtle move to keep it believable, but you can make the green color change as much as you want.
    54000210-M.jpg54000100-M.jpg

    This is what the channel mixer dialog looked like:
    54000224-M.jpg


    You may also notice that the sky got a bit darker. I was surprised about this at first because it appears blue not green, but after thinking about it a bit, I think this is what’s happening. If you look at the R, G and B channels, the red channel is almost black in the sky (no red in the sky). The blue channel is the lightest and the green channel is a mid-tone. All of that is expected and is true of most skies. Since the sky isn’t a perfect blue, it’s got some green in it. So, when we multiple the green value by 1.3, the sky gets brighter. But when we remove 30% of what’s in the blue channel from the green channel, the blue number is greater than the green number so we end up taking more out of the sky than we put in and the sky gets darker. Not only does it get darker, but we’re taking green out of the sky so it gets bluer too. Somewhat counterintuitive, but it works.

    Blending Color Channels to Remove a Cast

    In this last section of the chapter, Margulis discusses how to remove various color casts using channel blends. I will just have to admit that while I follow what he’s doing in this part of the chapter, I don’t yet understand why one would use it versus other methods for correct casts. I’ve learned how to correct color casts with RGB curves and I don’t know why you’d need or want to use a channel blend instead of curves. But, here’s what Margulis describes.

    First he explains that if you have a R, G or B color cast, then it’s pretty easy to understand that the channel that’s the color of the cast is too light relative to the other channels. If you have an intermediate color cast typically indicates that one channel is too dark. For example, if you have a blue-green (cyan) cast, then the red channel is too dark. If the green channel is too dark, you get a purple cast, if the blue is too dark, you get a yellow cast.

    In the sample image from the book, Margulis has a yellow cast which means the blue channel is too dark. At this point, I would typically just use a curve on the blue channel and pull it up where it’s off. Margulis describes an alternate method. In his image, he chooses to blend some of the red channel into the blue channel to lighten it up. He follows these steps:
    • Make duplicate layer
    • Apply Image on duplicate layer to blend red into blue using opacity of 32%.
    • Set blend mode to lighten in the Apply Image dialog so we only make the blue channel lighter.
    • This takes care of the yellow cast.
    Margulis doesn’t explain how he arrives at the 32% opacity. I presume he had some sample points in his image that he expects to be neutral and he found that 32% made them neutral.

    After fixing this color cast, Margulis then wants to increase contrast and visible detail in the priest’s face. He does this by using an earlier techique for improving faces. He does this by doing a 60% luminosity blend with the blue channel (replacing the luminosity of the image with 60% of the luminosity of the blue channel). That serves to both darken the face (it was too bright due to the illumination) and add detail. He then takes the image to LAB to further enhance the luminosity and color.


    Summary

    Lastly, Margulis summarizes the chapter into a couple distinct things to remember:
    • If you can do it all in LAB, it will probably be easier there because of the built-in separation of color and contrast
    • But, sometimes you can produce contrast-only or color-only work more easily in RGB than you can in LAB, particularly when you are making use of the RGB channels (usually for some type of blend) that are not available in LAB.
    • And remember that even when working in RGB, you can still separate color from contrast. You can either use the color or luminosity blend modes or you can make a version of the image optimized for detail and contrast, convert to LAB and use that resulting L channel as a new L channel to go with the original color.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • AndyAndy Bicameral New YorkPosts: 50,151Registered Users Major grins
    edited January 26, 2006
    I believe! I believe!

    bowdown.gif This is a lot of effort, John - and very well presented and summarized. Thanks for the awesome effort.
  • jfriendjfriend Scripting dude-volunteer Posts: 24,828Registered Users Major grins
    edited January 26, 2006
    Andy wrote:
    I believe! I believe!

    This is a lot of effort, John - and very well presented and summarized. Thanks for the awesome effort.
    Your welcome. This one took awhile. First, it took awhile to understand the chapter, it's not as "cookbook" as some previous chapters. Then, the longest part was finding sample images to illustrate the various techniques. The writing was actually the easy part.

    Boy, if you ever want to really understand a chapter, accept an assignment to write a summary and create your own sample images. You WILL learn it before you're done. Hmmm, I guess that's the same idea behind homework in school - I'll have to see if I can explain that to my kids (nahhh, they'll never buy it).
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • DavidTODavidTO Mod Emeritus Thousand Oaks, CAPosts: 19,160Registered Users, Retired Mod Major grins
    edited January 26, 2006
    John, I'm at work and don't have the time to read, I could only skim, but I have to say I'm very impressed. What a write-up! Can't wait to dig in and get all the Chap. 14 goodness!
    Moderator Emeritus
    Dgrin FAQ | Me | Workshops
  • VikingViking Major grins Posts: 178Registered Users Major grins
    edited January 27, 2006
    Very nice and informative. I dontudnerstand either to Why use channel blending instead of curves. Maybe faster and more inprecise.
  • jfriendjfriend Scripting dude-volunteer Posts: 24,828Registered Users Major grins
    edited January 27, 2006
    Look at the channels to help solve your problem better or faster
    Viking wrote:
    Very nice and informative. I dont understand either to Why use channel blending instead of curves. Maybe faster and more inprecise.

    You use channel blending when the channel has some unique structure to it that makes it easier to achieve a desired change than using a curve directly (which usually works globally). Sometimes you can do it either way. Sometimes, the channel blend makes the solution a lot easier. Sometimes you use both by using a channel to build a mask which you then apply a curve through.

    In the blue sky example in the writeup, you could have achieved a similar result with a curve + mask, but masks can be tricky to get perfect and make them imperceptible so in my opinion it's usually faster and more flexible to use a channel blend and blendif settings.

    A key point in this chapter about channel blends was to look at the channels and see if the information in them can help you solve your problem. It's not that there's a time when you have to use them or that they are the only way to solve the problem, but that they can be a valuable tool to help you solve problems easier or faster or more effectively.

    When people get really good at this, they use channels to solve some problems in a few minutes that I used to spend 30 minutes on with curves and masks. And, their results probably look better too and certainly are easier to tweak and change.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • dandilldandill Quantum mechanic Posts: 102Registered Users Major grins
    edited January 28, 2006
    John, this is a great bit of teaching that you have done with this summary. I especially appreciate the explanations you have added in various places. I am sure many others will benefit from the time you have spent creating this.

    One queston I have is about your alternative way of getting contrast:
    jfriend wrote:
    ...
    Just to show you that it can work, here’s a before and after where I manipulated the R, G and B curves in RGB mode to maximize contrast in the water, then converted to LAB mode and took the resulting L channel and pasted it into a fresh copy of the image in LAB mode (did an L channel replacement). In this particular image, I also had to confine the extreme luminosity change to the water to only apply to the water using blendif settings and a partial mask. The before and after is below. Look at the texture of the water to see how much detail was raised from the water by just steepening each of the R, G and B curves where there was detail in the water. This just spread out the luminosity in each of the separate color channels to add visibility to the detail that was already in the image.


    53984680-M.jpg53984639-M.jpg

    Could you give the details of this particular transformation?
    Dan Dill

    "It is a magical time. I am reluctant to leave. Yet the shooting becomes more difficult, the path back grows black as it is without this last light. I don't do it anymore unless my husband is with me, as I am still afraid of the dark, smile.

    This was truly last light, my legs were tired, my husband could no longer read and was anxious to leave, but the magic and I, we lingered........"
    Ginger Jones
  • jfriendjfriend Scripting dude-volunteer Posts: 24,828Registered Users Major grins
    edited January 28, 2006
    More details early next week
    dandill wrote:
    John, this is a great bit of teaching that you have done with this summary. I especially appreciate the explanations you have added in various places. I am sure many others will benefit from the time you have spent creating this.

    One queston I have is about your alternative way of getting contrast:
    Could you give the details of this particular transformation?

    I'm away from my photoshop computer until Monday, but I'll see if I can post more details on that one early next week.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • jfriendjfriend Scripting dude-volunteer Posts: 24,828Registered Users Major grins
    edited January 29, 2006
    Step-by-step: adding contrast to the water by separating contrast from color
    dandill wrote:
    John, this is a great bit of teaching that you have done with this summary. I especially appreciate the explanations you have added in various places. I am sure many others will benefit from the time you have spent creating this.

    One queston I have is about your alternative way of getting contrast:
    Could you give the details of this particular transformation?
    Here are the detail steps on how I did this with RGB curves and an L-channel replacement, completely separating color from contrast:

    We started with this image:

    53984680-M.jpg

    I noticed that the water was pretty flat looking and I thought that it might benefit from some contrast enhancement. I started by looking at the histogram in the water for the R, G and B channels. To do so, I used the rectangular selection tool to make a loose selection of just the water. The idea with the selection is to just get a representative sample of the water and to not get anything that isn't the water. After doing that, I look at the RGB histogram in the histogram pallette and see this:

    54313766-L.jpg

    You can see that each color channel occupies a very narrow range of tones except for a little tiny tail that goes up into the highlights. That tiny tail likely represents the whitecaps on the water. So, to add contrast, what we want to do is to spread these histogram peaks out, prying apart the narrow range of tones in the water. We'll want to push it fairly evenly, some higher and some lower, to preserve the overall luminosity of the water. If you tried to do this with a plain RGB curve, you can see it would be next to impossible because none of the three colors are in the same location on the curve. So, instead, we'll apply a curve to each color individually and steepen just the area of interest. While doing this, we will completely ignore the colors we see and only pay attention to the contrast/detail we see.

    So, referring to the red part of the histogram above, you can see that all the red detail is down in the bottom part of the histogram. So, I make a red curve like this. The point of this curve is to spread out the detail in the red part of the histogram without blowing the whitecaps highlights:
    54313781-M.jpg

    Then, I switch to the green channel and make a curve that steepens the active part of the green channel. Since a lot of the image is governed by the green channel, it's important here to not only bring out detail with steepening, but also to try to keep the overall luminosity at the right level. Remember, we are again ignoring color and only looking at luminosity and detail. Here's the green curve I applied:
    54313775-M.jpg

    When making these curves, the way I figure out if I've got the curve covering the right area is that I drag my mouse with the left button down over the image and watch where the dot is on the curve I've made. I'm looking for a situation where the dot stays in the steep part of the curve (except for the whitecaps). Then, while looking at the image, if I want more contrast/detail, I steepen the curve. If I think it's been overdone, I flatten the curve a bit.

    Lastly, I do the same for the blue tones with this curve:
    54313755-M.jpg

    That results in this RGB histogram below (when we select just the water so we're only looking at the water). If you compare to the original RGB histogram, you can see that each of the three channels is now separated into a wider peak by the three curves we applied and you see that there's some combing happening where there are missing tones in between (combing is the spikes separated by valleys that looks like the teeth of a comb). This is what often happens when you take a very narrow tonal range and spread it out. You succeed in stretching it out, but it leaves holes in between. Combing is not a good characteristic, but for now I'm not going to worry about that because this isn't the final image, we're only going to take the luminosity from this image, not the color values. We'll see what the histogram looks like after we do that. But, for now, you can see that we have spread out each channel and we can clearly see more detail in the new water. This is the RGB histogram after the curves:

    54316841-L.jpg

    And, this is what our image looks like now after the curves. You can see funny colors creeping into the water and obviously very strange colors are happening in the mountainous background. But, remember, we are ignoring color for now and only supposed to be looking at detail and contrast in the water area of the image:

    54313886-M.jpg

    Now, we want to get this image into LAB mode and then do an L-channel replacement. We can't just convert to LAB mode because our RGB curve adjustment layers won't survive the conversion. At this point, there are several different ways to end up with the right L-channel replacement. I'll describe the one particular way that I use, but it's not the only way.

    Take your image with the R, G and B curves and make a new layer on top that has the resulting image in it. In CS2, that's Ctrl-Alt-Shift-E and it will make a new merged layer on top. Then, delete the curve layer(s). I actually put my R, G and B curves into separate adjustment layers because that lets me more easily toggle one on/off or adjust opacity if something isn't right, so at this point I delete all three of my curve layers. This leaves me with two layers, my original with the new curved/enhanced contrast result on top. Now convert to LAB mode. When asked if you want to flatten, say no.

    OK, now you are in LAB mode. Your original image is in the bottom layer and the new weird color image with the RGB curves applied is on top. What we want to do is to make a new copy of our original and the copy the L channel from the curved top layer into that new layer. That will essentially do an L-channel replacement on our original. It will keep the colors from the original, but replace the luminosity from our RGB-curved image. To do so, I follow these steps (I think this is actually a lot fewer steps using Apply Image, but for some reason I tend to do it this way because it's a bit easier to see exactly what's going on and I don't always feel comfortable with Apply Image yet):
    • Duplicate the bottom layer (our original image). That gives you three layers original, dup of original and RGB-curved image on top.
    • Select the RGB-curved layer.
    • Go to channels
    • Click on the L channel.
    • Select All and copy to the clipboard
    • Click back on the composite channel.
    • Go back to the layers tab
    • Select the middle layer, turn off the eye on the top layer so you will be looking at the middle layer
    • Switch to the channels tab and select the luminosity channel
    • Paste in the L channel from the previous layer
    • Select the composite channel to see your whole image
    • Go back to the layers tab
    You have now replaced the L channel in the original with the L channel from the RGB-composite and we now have the result below. Notice that the weird colors are now gone, but we still have the same amount of detail and contrast, a much more desirable result. At this point, I've also added a mask to isolate our changes to only the water area. A blendif setting would almost do here since there are unique colors in the water, but the mask was easy too so that's what I did this time. Here's the image so far with the new enhanced detail in the water with the original next to it for comparison:

    54418228-M.jpg53984680-M.jpg

    If you compare this result to the one in my original posting, it's not quite the same. That's because I redid this over from scratch so I could capture all the intermediate steps and I was more interested in capturing the steps and intermediate curves and documenting how I did it than worrying about getting the exact same result.

    Now, that we've done the L-channel replacement, let's look at the RGB histogram to see what it looks like now. I take my image, convert to RGB , make a representative selection in the water and look at the histogram. Lo and behold, we have a much more desirable histogram now. The three channels are each broader and the peaks are stretched out and for reasons I don't quite know how to explain myself, we no longer have near as much combing in the histogram (still some in the green channel, but not as bad as before), we have much smoother transitions. Here's the new RGB histogram for the water area:

    54325533-L.jpg

    Summary

    To summarize, this is a classic example of separating color from contrast. While ignoring color completely, we enhance contrast using fairly strong R, G and B curves. Then, after flattening and converting to LAB, we take the L channel from this image and replace the L channel from our original with it, thus restoring the original color, but keeping our newly enhanced contrast.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • JustinasJustinas Beginner grinner Posts: 8Registered Users Beginner grinner
    edited January 30, 2006
    jfriend wrote:
    Here are the detail steps on how I did this with RGB curves and an L-channel replacement, completely separating color from contrast:

    We started with this image:

    53984680-M.jpg

    I noticed that the water was pretty flat looking and I thought that it might benefit from some contrast enhancement. I started by looking at the histogram in the water for the R, G and B channels. To do so, I used the rectangular selection tool to make a loose selection of just the water. The idea with the selection is to just get a representative sample of the water and to not get anything that isn't the water. After doing that, I look at the RGB histogram in the histogram pallette and see this:

    54313766-L.jpg

    You can see that each color channel occupies a very narrow range of tones except for a little tiny tail that goes up into the highlights. That tiny tail likely represents the whitecaps on the water. So, to add contrast, what we want to do is to spread these histogram peaks out, prying apart the narrow range of tones in the water. We'll want to push it fairly evenly, some higher and some lower, to preserve the overall luminosity of the water. If you tried to do this with a plain RGB curve, you can see it would be next to impossible because none of the three colors are in the same location on the curve. So, instead, we'll apply a curve to each color individually and steepen just the area of interest. While doing this, we will completely ignore the colors we see and only pay attention to the contrast/detail we see.

    So, referring to the red part of the histogram above, you can see that all the red detail is down in the bottom part of the histogram. So, I make a red curve like this. The point of this curve is to spread out the detail in the red part of the histogram without blowing the whitecaps highlights:
    54313781-M.jpg

    Then, I switch to the green channel and make a curve that steepens the active part of the green channel. Since a lot of the image is governed by the green channel, it's important here to not only bring out detail with steepening, but also to try to keep the overall luminosity at the right level. Remember, we are again ignoring color and only looking at luminosity and detail. Here's the green curve I applied:
    54313775-M.jpg

    When making these curves, the way I figure out if I've got the curve covering the right area is that I drag my mouse with the left button down over the image and watch where the dot is on the curve I've made. I'm looking for a situation where the dot stays in the steep part of the curve (except for the whitecaps). Then, while looking at the image, if I want more contrast/detail, I steepen the curve. If I think it's been overdone, I flatten the curve a bit.

    Lastly, I do the same for the blue tones with this curve:
    54313755-M.jpg

    That results in this RGB histogram below (when we select just the water so we're only looking at the water). If you compare to the original RGB histogram, you can see that each of the three channels is now separated into a wider peak by the three curves we applied and you see that there's some combing happening where there are missing tones in between (combing is the spikes separated by valleys that looks like the teeth of a comb). This is what often happens when you take a very narrow tonal range and spread it out. You succeed in stretching it out, but it leaves holes in between. Combing is not a good characteristic, but for now I'm not going to worry about that because this isn't the final image, we're only going to take the luminosity from this image, not the color values. We'll see what the histogram looks like after we do that. But, for now, you can see that we have spread out each channel and we can clearly see more detail in the new water. This is the RGB histogram after the curves:

    54316841-L.jpg

    And, this is what our image looks like now after the curves. You can see funny colors creeping into the water and obviously very strange colors are happening in the mountainous background. But, remember, we are ignoring color for now and only supposed to be looking at detail and contrast in the water area of the image:

    54313886-M.jpg

    Now, we want to get this image into LAB mode and then do an L-channel replacement. We can't just convert to LAB mode because our RGB curve adjustment layers won't survive the conversion. At this point, there are several different ways to end up with the right L-channel replacement. I'll describe the one particular way that I use, but it's not the only way.

    Take your image with the R, G and B curves and make a new layer on top that has the resulting image in it. In CS2, that's Ctrl-Alt-Shift-E and it will make a new merged layer on top. Then, delete the curve layer(s). I actually put my R, G and B curves into separate adjustment layers because that lets me more easily toggle one on/off or adjust opacity if something isn't right, so at this point I delete all three of my curve layers. This leaves me with two layers, my original with the new curved/enhanced contrast result on top. Now convert to LAB mode. When asked if you want to flatten, say no.

    OK, now you are in LAB mode. Your original image is in the bottom layer and the new weird color image with the RGB curves applied is on top. What we want to do is to make a new copy of our original and the copy the L channel from the curved top layer into that new layer. That will essentially do an L-channel replacement on our original. It will keep the colors from the original, but replace the luminosity from our RGB-curved image. To do so, I follow these steps (I think this is actually a lot fewer steps using Apply Image, but for some reason I tend to do it this way because it's a bit easier to see exactly what's going on and I don't always feel comfortable with Apply Image yet):
    • Duplicate the bottom layer (our original image). That gives you three layers original, dup of original and RGB-curved image on top.
    • Select the RGB-curved layer.
    • Go to channels
    • Click on the L channel.
    • Select All and copy to the clipboard
    • Click back on the composite channel.
    • Go back to the layers tab
    • Select the middle layer, turn off the eye on the top layer so you will be looking at the middle layer
    • Switch to the channels tab and select the luminosity channel
    • Paste in the L channel from the previous layer
    • Select the composite channel to see your whole image
    • Go back to the layers tab
    You have now replaced the L channel in the original with the L channel from the RGB-composite and we now have the result below. Notice that the weird colors are now gone, but we still have the same amount of detail and contrast, a much more desirable result. At this point, I've also added a mask to isolate our changes to only the water area. A blendif setting would almost do here since there are unique colors in the water, but the mask was easy too so that's what I did this time. Here's the image so far with the new enhanced detail in the water with the original next to it for comparison:

    54418228-M.jpg53984680-M.jpg

    If you compare this result to the one in my original posting, it's not quite the same. That's because I redid this over from scratch so I could capture all the intermediate steps and I was more interested in capturing the steps and intermediate curves and documenting how I did it than worrying about getting the exact same result.

    Now, that we've done the L-channel replacement, let's look at the RGB histogram to see what it looks like now. I take my image, convert to RGB , make a representative selection in the water and look at the histogram. Lo and behold, we have a much more desirable histogram now. The three channels are each broader and the peaks are stretched out and for reasons I don't quite know how to explain myself, we no longer have near as much combing in the histogram (still some in the green channel, but not as bad as before), we have much smoother transitions. Here's the new RGB histogram for the water area:

    54325533-L.jpg

    Summary

    To summarize, this is a classic example of separating color from contrast. While ignoring color completely, we enhance contrast using fairly strong R, G and B curves. Then, after flattening and converting to LAB, we take the L channel from this image and replace the L channel from our original with it, thus restoring the original color, but keeping our newly enhanced contrast.

    very usefull tutorial, thnx.
  • JustinasJustinas Beginner grinner Posts: 8Registered Users Beginner grinner
    edited January 30, 2006
    jfriend wrote:
    Here are the detail steps on how I did this...

    very usefull tutorial, thnx.
  • dandilldandill Quantum mechanic Posts: 102Registered Users Major grins
    edited January 30, 2006
    jfriend wrote:
    Here are the detail steps on how I did this with RGB curves and an L-channel replacement, completely separating color from contrast.

    ...
    John, thanks again for your care and detail. Looking over your shoulder is perhaps the best part.
    Dan Dill

    "It is a magical time. I am reluctant to leave. Yet the shooting becomes more difficult, the path back grows black as it is without this last light. I don't do it anymore unless my husband is with me, as I am still afraid of the dark, smile.

    This was truly last light, my legs were tired, my husband could no longer read and was anxious to leave, but the magic and I, we lingered........"
    Ginger Jones
Sign In or Register to comment.