# Topic awaiting preservation: To Greyscale (Page 1 of 1)

warjournal

From:
Insane since: Aug 2000

posted 11-05-2004 20:20

The magnificent return of Biker Chic.

After some mangling:

Notice that the spectrum across the bottom isn't quite true. This is because of the numbers used. Don't fret too much over it.

To Greyscale Part I

Lot's of junk out there about converting colours to greyscale. What we are going to do is look under the hood in a slightly different way. Long live the spirit of Tech-Slop.

A long time ago, there was HSL. In this model, L is simply Max(RGB). Not too hard to do using ChOps and Lighten:

Kind of bright, isn't it?

Eventually, HSB came along. In this model
B = (Max(RGB)-Min(RGB))/2

This can easily be done with an HSB adjustment layer and bringing the Saturation slider all the way down to 0%.

Definitely better.

Both of those methods have a bit of a downside. That being that there is no variation in final L across the various hues. It's all uniform.

Then there is XYZ. This colour space is based on human perception. In particular, just plain Y in XYZ.

In a bit of a refined form of XYZ comes Lab. In particular, just plain L in Lab.

Here is a quick look at just L as in Lab:

Just went Image > Mode > Lab and did a cut-n-paste. No big deal.

Notice that the spectrum is no longer uniform. The yellows are brighter and the blues are darker. Nice.

Now, to get L as in Lab, there is no direct conversion. Rather, you have to convert to XYZ first, then on to Lab. So:
RGB > XYZ > Lab
RGB > Y > L

Thanks to Chris Cox for confirming that.

This is where things get a bit weird.

Another way of getting final L based on perception is to:
1. New layer
2. Fill with 50% grey
3. Set blending mode to Saturation

Since Sat=0%, there is no real hue. All that leaves is L. But I'm not sure what flavor of L it is. Using this, we get:

Yes, that is different than L as in Lab. I suspect that this is actually Y as in XYZ. Currently unconfirmed, so I call this flavor 'suspect Y'.
Here, I've amplified the difference:

Notice that the differences are mainly in those yellows and blues. Neato.

Now, here is where things get even weirder... sort of.

Earlier I said that HSB > Sat=0% will create uniform final L across all hues. Well, this doesn't have to be the case. You can 'trick' HSB into converting using human perception in the same manner as suspect Y.
2. Bring Saturation all the way down to 0%.
3. Change the blending mode of the HSB Ad-Layer to Hue, Saturation, or Colour.

All of a sudden, HSB = suspect Y.

Why? Because Photoshop uses L as in Lab for blending modes. At least, that's what Adobe says. What I end up with is suspect Y.

Actually, it is a bit more complicated than that. But not to hard to figure it out. Remember:
- Hue is being converted using human perception
- Sat=0% = only L based on human perception of H
- Colour = Hue + Luminosity

If you put all of that together, you should understand why HSB can be based on human perception.

That's the end of Part I.
Coming soon- Part II: Fighting the Status Quo.

edit:
Forgot.
The difference between suspect Y and L as in Lab could be gamma, profiles, or something like that.
However, I think it's reasonable to assume that Adobe is using
RGB > Y > grey RGB instead of
RGB > Y > L > then back to grey RGB (RGB mode)

(Edited by warjournal on 11-05-2004 20:27)

mahjqa

From: The Demented Side of the Fence
Insane since: Aug 2000

posted 11-05-2004 21:39

I read it once. I kind of got the gist of it, but I'm rereading it to make sure I get it. I already noticed that desaturating pure yellow and pure blue gave the same greys in many situations, which still weirds me. (But hey, I have human perception.) One little niggle;

quote:
Another way of getting final L based on perception is to:
1. New layer
2. Fill with 50% grey
3. Set blending mode to Saturation

You can also just fill with white or black. They also have no saturation. Saves looking up #7F7F7F.

I really dig how you manage to distill Photoshop's inner workings by simply experimenting. I already expect you to answer questions with "Elementary, my dear Watson".

(Edited by mahjqa on 11-05-2004 21:40)

(Edited by mahjqa on 11-05-2004 21:43)

warjournal

From:
Insane since: Aug 2000

posted 11-05-2004 21:51

I'm just so used to using 50% for a variety of things.
Handy for HSB stuff and making D-Maps.
Also comes in handy for a variety of invert and pseudo-invert tricks.

Excellant catch, Mahjqa.

The gist
Convert to grey using two different ideas
1. B as in HSB. This will give uniform grey for all hues.
2. Human perception, L in Lab or Y in XYZ. Yellow = brighter and blue = darker.

warjournal

From:
Insane since: Aug 2000

posted 11-06-2004 04:00

Part IIa Control

So we've looked at two main ideas for converting RGB to greyscale. One is based on human perception and the other isn't. Even kind of mixed the two and saw some slightly bizarre behavior. But it's still all good.

I originally pulled Biker Chic out of retirement to talk about this whole thing. She makes a good candidate for this because the photo has green, blue, orange, and some purple/magenta. However, I've decided to put her back in her box. She got some fresh air and should be good for a while. Besides, I know you folks can find good photos for your own fiddlings.

What we are looking for is control over what final L that the various hues will be converted to. For example, you might want greens to be darker and blues to be lighter. Or you might want reds to be lighter and cyans to be darker. That is what we are going for.

Because of that, I think it's best to use B as in HSB. This way all of the hues are uniform and can be tweaked either way without much fuss. If you go with human perception, yellows will be brighter and you just might want yellows to be darker, which means a bigger tug on the tweaks. Know what I mean?

Before we got more into that, let's talk about contrast and Margulis.

From Steve we've heard the Margulis way of putting contrast into a final greyscale.
1. Ad-Layer > HSB using Sat=0%.
2. Between that and the photo, Ad-Layer > Curves and tweak the contrast in the separate R, G, and B channels.

Layers something like this:
3. Ad-Layer > HSB to desaturate
2. Ad-Layer > Curves to manually tweak contrast
1. Colour photo.

Very nice. My prefered method for converting flesh to grey.

Let's say that Curves looks good for a person in the foreground, but the tweaks destroy the sky and clouds. Well, just mask it out and maybe give own tweaks with another Ad-Layer and some more masking action.
Love it!

Time to get back to converting H to L, but with Russell Brown's variation:
1. Ad-Layer > HSB using Sat=0.
2. Between that and the photo, use HSB, set blending mode to Colour, and tweak H and S to get what you want.

The advantage of this is that you are 'directly' converting hues to L (notice the quotes). The major bonus to this is that HSB has a drop-down for the major hues and sliders for range and fall-off. That is very nice.

So, with Brown you are selecting a range of hues and then tweaking to be lighter or darker. Or are you...? In a manner of speaking, yes. However, let's take a closer look at Brown's method. Believe me, there is lots of good stuff in there.

First, there is Colour mode. This is Hue + Sat (a mistake I made over at U2U). So, C = H + S.

What happens when you change the blending mode of HSB to Colour? Suddenly it is based on human perception and not B as in HSB. So far, not too bad.

Now, Brown shows tweaking H and S in the tweak HSB Ad-Layer. Since this is Colour and now working on human perception, moving H will affect final L as it gets desaturated through the top HSB Ad-Layer.

So, using just Hue to make a hues darker, shift to blue. Right? Try it and see what happens. A neat one to try is to make yellow darker by shifting it to blue. Or try making any hue lighter or darker just by shifting Hue to yellow or blue. You just might be surprised.

While the fall-off sliders are good, they are not good for this. For example, you can't shift blue and magenta to yellow in one swoop. When you shift a range, you shift the whole range. You will have to divide it up.

Which brings us to the Saturation slider.

Now, in HSB, S and B are *very* intimate. When you change one, more often than not you change the other. The rules for this depend which is greater. If you experiment with moving S and L, you should be able to see how this works. You should also be able to see how this is not so great for making hues darker or lighter because L is left alone in Brown's variation.

Why move H and S to get a final L?
Quite frankly, I don't get it. I understand the technical fallicies, but taking this tack seems so wrong even without that understanding.
If you want to convert H to L, then convert H to L, damnit.

My variation on Brown's variation:
Leave the HSB Ad-Layer in Normal mode.
Use the drop-down and fall-offs to select a range.
Use the L slider to lighten or darken the range.
If you want yellows lighter, then make them lighter.
If you want greens darker, then make them darker.
No sense in messing around with H and S.

Simple and direct. Extremely controllable and predictable.
Even makes use of the entire range selected using the fall-offs. That is, you can darken yellows and reds in one swoop.

Part IIb Fighting the Status Quo

In the past and recently, I've taken some flack for tearing apart Brown's variation. I honestly have no idea why. I suspect that it's because Brown is Brown and I'm just some guy. Even so, that doesn't make sense as a technique should stand or fall on it's own.

I've had to fight the status quo in the past with Displace. You folks were always with me, and I really appreciate it. You didn't see a lot of the ugliness that I had to put up with, but you always supported me when I came home.

Can't really say that I have the strength to go through that all over again.

You know, with the HSB stuff that I've been talking about recently, I was headed in this direction anyways. Kind of a strange coincidence. It's like I'm turning all of this techie stuff into a response to a flame war. But what I said should still stand without the bias.

Hell, I don't know. I'm just some guy.
I guess the best I can do is pass it on to you and keep on truckin'.

That's enough of that.

mahjqa

From: The Demented Side of the Fence
Insane since: Aug 2000

posted 11-07-2004 01:40

Questions or comments? Well, I've got another thing...

quote:
Now, here is where things get even weirder... sort of.

Earlier I said that HSB > Sat=0% will create uniform final L across all hues. Well, this doesn't have to be the case. You can 'trick' HSB into converting using human perception in the same manner as suspect Y.
2. Bring Saturation all the way down to 0%.
3. Change the blending mode of the HSB Ad-Layer to Hue, Saturation, or Colour.

All of a sudden, HSB = suspect Y.

Well... that's not really because of the hue/saturation layer. Remember where I set that instead of filling with 50% gray you could just as easily fill a layer set to 'color' with black or white? A HSB layer where saturation is zero will have the same effect as a layer filled with white, black or gray set to Hue, Saturation, or Colour, since it IS a layer with only white, black and grays.

So.. it's not weird that you get back to suspect Y.

Also, I tried your way of controlling brightness using falloff sliders and such, and I must say it works like a charm.

As for taking flak for tearing apart other people's theories (I don't even know this Brown guy anyway), there's only one rule in my book: "If it's stupid and it works, it ain't stupid." If your way works, then that's great! And it's not like you shove your methods down anybody's throats. If people don't like the way you work, they can get back to that Brown guy. No loss there. But if they DO gain more insight/knowledge or simply get the job done faster/better, then that's a good thing.

sPECtre
Nervous Wreck (II) Inmate

From: Belgium
Insane since: Oct 2003

posted 11-07-2004 18:08

Mahjqa, Russell Preston Brown is the senior creative at adobe.
Check out his site: http://www.russellbrown.com/tips_tech.html

No, WJ, you are far from Joe Average! you are Warjournal/Stroker from Borg!

You gave us a lot of food for thought!

Pierre Courtejoie

(Edited by sPECtre on 11-07-2004 18:09)

warjournal

From:
Insane since: Aug 2000

posted 11-07-2004 18:57

Yeah, that's the guy. Thanks, Spec.

The whole Borg thing still gives me the giggles. Started in these very halls - goes back to a joke involving my very first sig. If I remember correctly, it was Punchdrunk that got the Borg thing rolling with a sig request. Then the humour started flying and there you have it.

Mahjqa, I'm not sure if you are getting what that little chunk is about or not. It's about changing how HSB desaturates. In Normal mode, it desats regular. With a different blending mode, it changes to using human perception.

Or maybe we are saying the same thing but in different ways.
Can't say for sure because I'm still a little fried.

As for the other stuff, I'm doing my best for a "take or leave it" kind of attitude.
Of course, whatever works and what you're comfy with.

(Edited by warjournal on 11-07-2004 18:58)