Transposing colors using LAB
Ben (121 points) | Tue, 2005-09-13 20:49
A recent discussion sparked the idea of using LAB colorspace for transposing colors. In this lesson, I will show you why and how to do it.
LAB color is made up of three components/channels: L, A, and you guessed it B. The lightness channel L carries all of the contrast while the color channels A (green-red) and B (blue-yellow) carry… well, the color. LAB keeps color and contrast isolated from each other, so adjusting the curves of one will not affect the other. Although a simple color shift can be done using a simple method such as HUE, major color shifts going from one side of the color wheel to the other can benefit from the power of LAB.

When a big color shift is made in the RGB colorspace using HUE, you can see where highlight/shadow detail is lost and compression artifacts start to show up from the lighter channels.
Convert your image to the LAB colorspace by going to Image: Mode: Lab Color.

Create an adjustment layer by clicking the half-filled circle icon at the bottom of the layers palette and choose Curves.

Creating a certain color other than its opposite requires a bit of practice writing curves, so in this case we are just going to turn it upside down on both the A and B channels. Do this on the A channel by dragging the bottom-left point to the top-left, and drag the top-right point to the bottom-right. Repeat for the B channel. Leave the L channel untouched unless you wish to write a curve boosting the contrast like in my attached PSD.

So the color on the car looks great, but what about the rest of the picture? And how come when you apply an effect to a layer, it’s called Blending Options?

Control-Click the adjustment layer and choose Blending Options from the context menu. If you are anything like me, you completely ignore the first screen that pops up and immediately click on an effect. BUT WAIT, you see that bottom box that says Blend If? Change the channel to A and set the blending range to my example. Split the arrows apart by option-click-dragging them. This basically blends the top color to the bottom color in the range we set. Play around with the sliders, you will see it in action. Check out how the reflection on the fender keeps the color of the sky! Watch what happens if you uncheck B in the middle Advanced Blending box.

Everything is looking awesome, but because there are certain elements (brake lights) that need to stay red, some very simple masking is required. The adjustment layer already includes a layer mask. Select the elliptical marquee tool and make a selection around the brake lights and anything else you want to exclude from the color change and fill the selection black in the mask. I selected the rims also because they are actually reflecting the sky, which should be red. I also masked out the top of the sky because it turned a bit blue.

Because we are using the blend if options, there is no need for a complex mask to be drawn around any edge of the whole car!
Time to go impress your friends and coworkers. Please post your results using different variations or another picture! The original PSD is attached so you can see my curves, blending options, and mask.
BENLEIVIAN.com
Commenting on this Blog entry is closed.
| Attachment | Size |
|---|---|
| labProject.zip | 430.15 KB |
WOW.. for lack of a better word :)
---
http://twitter.com/waleedalzuhair
I found this Photoshop tip very interesting, and I must try it out sometime, perhaps on a nice car.. :)
Thanks for the tip, more to come I hope =)
great tutorial, thanks Ben!
there used to be a plugin for Photoshop that did it almost automatically. I can't remember the name but I only tried out the demo cause it was way expensive (I was a student at the time, using a copy of Photoshop that came with my scanner. ), and I think it was discontinued.
anyone know what it was?
Aww, but it's so much more fun this way :] Also like you said, that plugin probably costs a lot of money and when it stops getting supported, you're out of luck. If you find yourself using this technique a lot, put every step except the masking part into an action and make your own customized plugin(sort-of) for free!
BENLEIVIAN.com
This is a great hint; very useful, but not too complex to pull off. Thanks for sharing it.
That's an awesome technique. I wanted to try out how better it is than the regular quick and dirty Hue change. Here is the result.
1. The most obvious difference and improvement with the LAB technique you described is that the color is shifted more correctly. There are no color casts. Look at the area of the left headlight and the Taxi signage on the side. On the HUE option it has a greenish color cast.
2. Much more detail is retained with the LAB technique. If you look at the reflections there is more detail and better contrast. You may be able to fix this on the HUE image, but with further destruction of color data.
3. It's not apparent in this small size, but very visible in bigger sizes that there is much more noise and striping going on in the HUE version. The LAB version is very clean.
Thanks a lot for this very useful tip!
Every so often, I like to 'file' away articles I want to keep for future reference. I have a gmail account and keep a 'Label' called 'Tutorials', so while still in Creativebits, I just hit on the mac (apple+I) and apple mail pops up, I enter my gmail address and use the plus addressing eg
"yourname+tutorials@gmail.com" and mail sends a complete copy of the article in html form to the gmail account which automatically gets filed in the 'Tutorials' label.
Now whenever I need to refer anything, I just check in gmail.
I have found this quite helpful for various other bits of info!
Sam
Print and Mac troubleshooting Guru
Print and Mac troubleshooting
brilliant! just brilliant!
This is a very helpfull tip!!
This is quite handy. I often do work for a car company and typically they will supply us with a particular picture, then have us change the colour after the fact. I've done this process a bunch of times using masks, so this is just awesome for me.
SlideawayMedia - web design for Cambridge, Kitchener, Waterloo, Guelph and surrounding areas.
http://www.modsuperstar.ca - now with 23% more iron