Sunday, January 15, 2006

Black and White Conversion of Flower

Still putting together a post on general black and white conversion techniques... there are a lot of different ways to go about it!

In the meantime, a couple people have asked how the final black and white version of the flowers in the Black and White Conversion 101 post was created - it was actually really simple and fast. No doubt somebody else could come along with some different way of converting it that would render a better result, but this is pretty good for a 30 second job I think, and really that conversion was just to illustrate the point of the article anyway.

OK, open the original colored image (in RGB) - take a look at each channel and look at the tonal range that it occupies.

3 Roses Red Channel

The red channel basically sucks as a conversion source - there is so much red in each of these flowers that there is essentially no tonal differentiation between the three, and very little detail overall.

3 Roses Green Channel

The green channel looks pretty good, but the three flowers are still tonally a bit close together. This channel at least has some merit though.

3 Roses Blue Channel

For the purposes of the previous post, the blue channel looks great for the two flowers on the right, but the left flower is far too dark.

Still, the blue channel looks pretty good as a starting point... it looks like if we were take the two flowers on the right from the blue channel and the flower on the left from the green channel, that might provide pretty good tonal differentiation between the three.

So, given these channels as a starting point, this conversion was really just a two-step job:

1) Copy the blue channel to a new grayscale document, on the theory that two out of three ain't bad.

2) Put the green channel on the layer above, toss in a mild curve to enhance the contrast in the leftmost flower just a little bit, and tweak the blending options appropriately to pick up only the midtones from the layer.

3 Roses Final Grayscale Conversion

And there you have it. Other than playing around with the blending sliders, it takes longer to describe than it does to execute.

There are a LOT of different ways to create a black and white image - this was kind of quick and dirty and yet obviously gave a result far better than a straight grayscale conversion - no contest.

This was also a very easy image, set up specifically to illustrate the point in the previous post - most real-world images are not nearly so conveniently defined within the channels, so usually there are more steps involved in a good conversion, typically with a good bit of channel blending ahead of time to establish the tonal differences that you want in the overall color image prior to the conversion.

But that is for next post...

Friday, December 30, 2005

Black and White Conversion 101

Happy holidays everybody! Just a short one today so I can get back to leftovers ;-)

The latest generation of inkjets are amazingly good at making incredibly rich and neutral black and white prints that rival traditional black and white film prints, and the subject of how best to convert pictures to black and white is a popular one and only getting moreso. There are tutorials all over the net with different conversion methods, most of which work at least reasonably well for some images, but what seems to be missing from most of them is a discussion of what you are actually trying to achieve. The authors seem to either assume that you already know what the critical factors are in creating a good black and white image, or, worse, they simply give a list of steps as a sort of recipe to follow, which guarantees good results for some images and not-so-good results for others.

With the power and flexibility of the digital darkroom, once you understand the factors that a successful black and white conversion needs to take into account you have available to you conversion processes and techniques that were traditionally very hard if not impossible to achieve. You can take advantage of the collective knowledge and best practices of both the prepress and traditional film photography industries as well as a large number of new techniques developed exclusively in the digital darkroom, and you can relatively easily achieve outstanding results using techniques that would have taken a traditional printmaker years to master.

So what are the factors of a successful black and white conversion?

There is really just one key concept to get your head around: you have to map detail contained in color (hue and saturation) contrast into luminosity (brightness) contrast - that is, if you want to see that detail in the resulting black and white picture!

This is the absolutely central conceptual point in achieving a good black and white conversion, so stick with this if you didn't get that last statement. If you already know color theory this next bit will be quick.

In a color picture, each pixel has a color, and a color is made up of a hue, which is a particular point in the visible color spectrum, a saturation, which very loosely can be thought of as the purity or intensity of the color, and a brightness level, which is self-explanatory. An intense orange, for instance, would have a hue in the orange part of the color spectrum (in between red and yellow) and would be both very bright and very saturated. A neon green might also be very bright and very saturated, but would have a different hue in a different, cooler part of the color spectrum (in between blue and yellow.) A forest green might have the same hue as the neon green, and perhaps the same level of saturation, but much less brightness. A pastel green might have the same hue and the same brightness as the neon green but less saturation. Likewise, a dark brown might have the same hue and saturation as the intense orange, but much less brightness.

So the three values that in combination indicate a color are hue, saturation and brightness. This is indicated by the acronym HSB, and is the simplest way to indicate a color value (for the purpose of this discussion.) Any color that you can think of can be indicated by a unique combination of hue, saturation and brightness (simplistically expressed - color theorists and Pantone agents out there don't toast me please, I am trying to simplify here.)

Technical side note: there are other methods to indicate a color value as well... RGB stands for Red-Green-Blue and is a representation of the control voltages in your monitor that control the intensity of the red, green and blue signals that you see on your screen; CMYK is Cyan-Magenta-Yellow-Black (yes, 'k' is black) and is from the printing industry and represents the amount of ink on paper to achieve a given color; LAB is Luminosity-A-B and represents the way that the eye sees color. There are others as well. HSB however is the most useful for this discussion.

So, in a color picture, every pixel has an HSB value. When you look at the picture, you see one area as bright orange and another as bright green because, while the saturation and brightness are the same, the hue is vastly different, and you see the forest green and the dark brown as different colors for the same reason. You can see the difference between a red rose and a pink one and an orange one because they vary in hue and saturation. You see the difference between a forest green object and a neon green one, or a gray and a black for that matter, because the brightness levels are different, even though the hue and saturation are the same.

In short, you are able to discern detail in the color photograph through variation in all three of the HSB values.

3 Roses - Color Version, varying only in hue and saturation

So why have we wandered off into color theory, and what does this have to do with getting a good black and white conversion?

OK, here is the important bit...

A color photograph achieves its detail through variations in hue, saturation and brightness. When you convert to black and white, the only variation that is available is brightness. This seems fundamentally obvious, but typically only in hindsight so it is worth saying again. The only variation that is available to indicate detail in a black and white image is brightness. Any information that was conveyed by change in hue or saturation in the color image must be mapped to a change in brightness in the black and white conversion, or that information will be lost.

So if you have a color picture of a red rose, a pink rose, and an orange rose, varying in hue and saturation but close to each other in brightness, and you convert that picture to black and white without taking this into account, all three roses will still be the same brightness level and will end up the same implied 'color' in the final image - probably not what you are going after. Things that appeared vastly different in the color image end up looking pretty much the same in the black and white, detail is lost, and you end up with an unsatisfying black and white conversion.

In the color picture above, the three roses vary only in hue and saturation, but not at all in brightness... this picture was chosen specifically to illustrate this point. This black and white version was created by simply doing a straight grayscale conversion.

3 Roses - Grayscale Version 1, using default grayscale conversion

As you can see, all the variation that came from the color component of the original image has been lost - these three roses might all be pink or orange or red or white for all we know, but the clear indication that our brain receives is that they are all the same color. The color information has been lost.

Once you get your head around the simple fact that you have three information vectors in the color image that have to be mapped into one in the black and white, then your job in making the conversion starts to become a lot more clear.

First you must analyze the image to understand what important detail is contained only in the hue or saturation and not the brightness, and is thusly going to be lost in the conversion to black and white. Then you take the necessary steps to map that detail to brightness in some way using the many techniques available, many of which fall into some variation of channel blending or curves, but the key always being that you are taking detail contained only in hue and/or saturation and in some way mapping it over to brightness, or taking detail already contained in brightness and enhancing it to compensate for the loss of the hue and saturation detail from the same area.

3 Roses - Grayscale Version 2, mapping hue and saturation variation to brightness variation prior to conversion

This is the key concept in black and white conversion, and once you understand it all the techniques you run across will start to make a lot more sense. Only once you understand this (relatively simple) concept can you reasonably tame the black and white conversion process.

I'll get into some specific techniques both for determining what detail is contained only in hue and saturation and as well for mapping it to brightness in upcoming posts as this is enough to digest right now, and certainly enough to have written at this hour of the night... :-) 'til next time, happy imaging and all that.

Friday, December 23, 2005

Photoshop Memory Usage

I tend to keep my applications running for long periods of time without restarting... So the other day I look up and notice that Photoshop, with one 7MB PSD file open, is using 1.2GB of ram! It is a hell of an app that can bring a 2GB system to its knees just sitting there doing nothing but moving elements around and running a few filters, but Photoshop seems to go through memory like some people go through cars.

It uses some memory for a little bit and then says 'Oh I'm bored with this memory! It is cluttered and dusty and too small and the curtains are drab... I've heard about some great new memory down the way where things are shiny and the air is clean... Quick, lets go!'

And all the little Photoshop digital gnomes/gremlins/hamsters/nano-Knoll's gather up their hard hats and slide rules and hop in their golf carts and go speeding off to a different area in memory and look around and say 'Wow! Look at all this space! Quick, somebody plant a flag! Everybody, spread out - there's plenty of room! Quick now, run some filters!!' Chug-chug-chug-chug...

And THAT, I think, is why Photoshop is using 1.2GB of ram holding open a 7MB PSD file... just a matter of decor really.

Clearly I need more ram...

Friday, December 16, 2005

DNG Recover Edges Tool

Did you know that most digital cameras capture more pixels than are finally output? If you look at the specs on your camera, you may see two numbers, sensor megapixels and 'effective' megapixels... the former is what the sensor captures, the latter is what you actually, for various technical reasons, get out of the camera.

But sometimes you REALLY want to recover those few extra pixels - often because of compositional issues, or perhaps you've just forgotten to take your OCD meds again. ;-)

A nifty little free utility from ultra-wizard Thomas Knoll (of Photoshop fame) allows you to do exactly that. There are some caveats, but if this sounds useful, check it out: DNG Recover Edges

Big props to Thomas for being such a very cool photographer-programmer dude and being one of the driving forces of the digital imaging revolution; he is a quiet guy who makes a big difference. And props to Michael Reichmann for hosting the download and getting the word out about it.

Monday, December 12, 2005

What is a camera RAW file?

When you take a picture with your digital camera and look at it on the screen (either of the camera itself or later, on your computer), you aren't seeing a direct representation of what the sensor in the camera recorded - if you were it would be very dark and speckled and muddy looking with bad color and not really a very good picture at all. What you are seeing is the data from the sensor after it has been interpolated and gamma-adjusted and white-balance corrected and had a contrast curve applied and been sharpened and converted to a display color space and all kinds of other fancy techno-magic type stuff that your camera is performing on your behalf.

The camera is effectively rendering an interpretation of the image, and generally speaking the modern digital cameras do a pretty amazing job of this, but it is an interpretation nonetheless.

The analogy that is commonly given is to traditional photography: the data from the sensor can be thought of as the negative, and the preview that you see on the screen, and later the JPEG image that you download from the camera, are effectively prints of that negative, developed for you by the camera.

The camera is acting as a film lab for you, and doing a very good job in most cases, but no camera or computer can understand truth, beauty, art, aesthetic balance, and all that other blather. As good of a job as the camera does in most cases, with just a little practice you can do better...

And sometimes the camera just plain screws up.

So, simply put, a camera RAW file is effectively the raw data that the camera sensor recorded... un-interpolated, uncorrected, linear-gamma, and in need of lots of processing before it looks pretty. This is your digital negative, from which you can make many different prints of different styles and interpretations, and utilize many different digital darkroom techniques to achieve optimum image quality.

Having this level of ability and control over your final images is one of the most empowering aspects of the digital photography revolution, and shooting in RAW format takes it up to a new level.

In an upcoming post I will cover the unique benefits of working with camera RAW files more specifically, but in the meantime if you want to read a more-detailed explanation of all this, check out Understanding Raw Files over at the Luminous Landscape...

Thursday, December 08, 2005

Quick Tip: Luminosity Blending to Avoid Color Shifts in Tonal Corrections

Sometimes when you are performing tonal corrections on an image using levels or curves you introduce subtle (or sometimes not-so-subtle) color shifts as well. If this becomes a problem you can blend your tonal corrections in luminosity mode rather than normal mode - this will allow the adjustment layer to modify the luminosity of the image but not the color, and will prevent any color shifts.

You can extend this to any corrections you perform that are intended to be tonal in nature only... contrast enhancements, sharpening, and many other forms of tonal adjustment all can be limited in this way if they are causing undesirable color shifts.

Tuesday, December 06, 2005

Quick Tip: Non-destructive Dodge and Burn

To perform non-destructive dodges and burns on a layer, try the following:

Create a new topmost layer (I usually name it DnB), set its blend mode to Overlay and fill it with the layer-neutral color (in this case RGB 128, 128, 128 - 50% black.) At this point your image should appear unchanged.

With the new overlay layer still selected, use the dodge and burn tools as you normally would; this will darken or lighten only the overlay layer, as opposed to the underlying image pixels. Don't worry if you go a little too far as you can always switch tools and reverse the effect in a specific area, and you can also reduce the opacity of the entire overlay layer to reduce the overall dodge and burn effect on the whole image.