Issuu on Google+

Chapter 5: HDR Image Processing

HDR Image Processing

“Being ‘undigital’ with digital images”—that was the title of one of the very first papers on HDRI, written in 1995 by the visionaries Mann and Picard. And that is what it’s all about. Working directly in floating-point space is bringing image editing back home to a world where you think in f-stops, gradient ND filters, and adding light or taking it away, without ever being worried about digitally degrading your image into pixel mush. Believe me, once you have tasted the full sweetness of HDRI, you won’t ever want to go back.

5.1. Taking Advantage of the Full Dynamic Range The techniques I am about to show are all derived from digital compositing. Just a couple of years ago, ridiculously expensive movie production suites were the only systems capable of working in floating-point precision. That, and the fact that they lift all the weight of 32 bits in real time, was their major selling point. Nowadays, every off-the-shelf compositing package has the same capabilities, albeit not the speed. So these techniques work in After Effects, Fusion, Combustion, you name it. However, I’ll demonstrate them in Photoshop. Why? Because I can. The new layer and painting capabilities in CS3 Extended allow me to do so. You’ve already seen how selective exposure adjustment works. I called it the human tone-mapping operator. Well, that was just a fraction of where this can go.

This chapter is not about tone mapping. Or better said, it’s about not to tonemap the HDR image yet. We will have a look at image editing in floating-point space.

213

5.1.1. Blocking Light: Day for Night This is a good one—feel free to work along starting with the Egyptian.exr from the DVD. We’re going to apply some movie magic to this image, just as professional matte painters do on a daily basis. We will change the image into a night shot. Sunlight to moonlight e We start out the very same way it would be done if we were working with a camera: We put a blue filter in front of the lens. In digital terms, that would be a new solid layer with a dark blue color. The color is chosen according to what I feel the darkest shadows should look like.

r Next, we set the blending mode of the layer to Multiply. That makes this layer the direct equivalent of a filter in front of the lens. It blocks out light, in this case a lot of it. A very brutal filter it is, indeed. But don’t panic, it’s all still in there. We just have to adjust the exposure of Photoshop’s virtual camera, just as we would do with a real photo

5 Before


Chapter 5: HDR Image Processing

HDR Image Processing

“Being ‘undigital’ with digital images”—that was the title of one of the very first papers on HDRI, written in 1995 by the visionaries Mann and Picard. And that is what it’s all about. Working directly in floating-point space is bringing image editing back home to a world where you think in f-stops, gradient ND filters, and adding light or taking it away, without ever being worried about digitally degrading your image into pixel mush. Believe me, once you have tasted the full sweetness of HDRI, you won’t ever want to go back.

5.1. Taking Advantage of the Full Dynamic Range The techniques I am about to show are all derived from digital compositing. Just a couple of years ago, ridiculously expensive movie production suites were the only systems capable of working in floating-point precision. That, and the fact that they lift all the weight of 32 bits in real time, was their major selling point. Nowadays, every off-the-shelf compositing package has the same capabilities, albeit not the speed. So these techniques work in After Effects, Fusion, Combustion, you name it. However, I’ll demonstrate them in Photoshop. Why? Because I can. The new layer and painting capabilities in CS3 Extended allow me to do so. You’ve already seen how selective exposure adjustment works. I called it the human tone-mapping operator. Well, that was just a fraction of where this can go.

This chapter is not about tone mapping. Or better said, it’s about not to tonemap the HDR image yet. We will have a look at image editing in floating-point space.

213

5.1.1. Blocking Light: Day for Night This is a good one—feel free to work along starting with the Egyptian.exr from the DVD. We’re going to apply some movie magic to this image, just as professional matte painters do on a daily basis. We will change the image into a night shot. Sunlight to moonlight e We start out the very same way it would be done if we were working with a camera: We put a blue filter in front of the lens. In digital terms, that would be a new solid layer with a dark blue color. The color is chosen according to what I feel the darkest shadows should look like.

r Next, we set the blending mode of the layer to Multiply. That makes this layer the direct equivalent of a filter in front of the lens. It blocks out light, in this case a lot of it. A very brutal filter it is, indeed. But don’t panic, it’s all still in there. We just have to adjust the exposure of Photoshop’s virtual camera, just as we would do with a real photo

5 Before


214

Chapter 5

HDR Image Processing

e3

A blue solid layer is the foundation.

1u

Fixing the sky.

1r

Blending mode Multiply turns the blue solid into a photographic lens filter.

1t

Adjusting the virtual exposure permanently.

exposure is good enough—as long as we can keep our quick exposure slider in the center position because that slider will reset when the file is closed. Great. Now the sunlight is moonlight. The sky is just a bit too bright for a night shot.

u To fix the sky, we have to select it first. For camera when we shoot through a physical filter in front of the lens.

t In this case, we want that to be a persistent global change, so we do it in the 32-bit Pre-

view Options dialog from the View menu. We could do the hard adjustment from the Image menu as well and burn the new exposure to the HDR values, but since we will be finishing this piece in Photoshop, that 32-bit preview

some reason the Magic Wand doesn’t work in 32-bit mode, but the Quick Selection tool does. So we use that and draw some strokes across the blue. Then we add an Exposure adjustment layer with the widget on the bottom of the Layers palette. It will come up preloaded with

1i

This blue solid layer is doing all the work.

our selection mask. Now we can pull down the exposure selectively on the sky.

i That is our basic high-dynamic-range composite. If you toggle the blue solid layer on and off, you can really see how effective it is. A PSD file of the current state is also on the DVD, in case you would like to dissect it. For our next step, it is very important that there is so much difference between these two. Our original doesn’t have much DR to begin with—it has easily fit within the monitor range. But now we’ve boosted everything up, beyond the white point even, and we’ve

215


214

Chapter 5

HDR Image Processing

e3

A blue solid layer is the foundation.

1u

Fixing the sky.

1r

Blending mode Multiply turns the blue solid into a photographic lens filter.

1t

Adjusting the virtual exposure permanently.

exposure is good enough—as long as we can keep our quick exposure slider in the center position because that slider will reset when the file is closed. Great. Now the sunlight is moonlight. The sky is just a bit too bright for a night shot.

u To fix the sky, we have to select it first. For camera when we shoot through a physical filter in front of the lens.

t In this case, we want that to be a persistent global change, so we do it in the 32-bit Pre-

view Options dialog from the View menu. We could do the hard adjustment from the Image menu as well and burn the new exposure to the HDR values, but since we will be finishing this piece in Photoshop, that 32-bit preview

some reason the Magic Wand doesn’t work in 32-bit mode, but the Quick Selection tool does. So we use that and draw some strokes across the blue. Then we add an Exposure adjustment layer with the widget on the bottom of the Layers palette. It will come up preloaded with

1i

This blue solid layer is doing all the work.

our selection mask. Now we can pull down the exposure selectively on the sky.

i That is our basic high-dynamic-range composite. If you toggle the blue solid layer on and off, you can really see how effective it is. A PSD file of the current state is also on the DVD, in case you would like to dissect it. For our next step, it is very important that there is so much difference between these two. Our original doesn’t have much DR to begin with—it has easily fit within the monitor range. But now we’ve boosted everything up, beyond the white point even, and we’ve

215


216

Chapter 5

HDR Image Processing

217

1u

Repeat the workflow on the lantern.

i3

Adding a touch of interactive light.

1 e : Sketching a rough selection with the polygon tool.

t The shadow line is a little too hard now;

1r

A gradient in the layer mask lets the original image shine through.

had the solid layer bring it down again. In the figurative sense, we were winding up the dynamic range here.

1t

Adding some spill light and fitting the mask with the Smudge tool.

sketch out where the light would be hitting the walls.

r Make sure to have the alpha mask of our It’s all about the mood e The fun is just about to start, because now we’re going to add a little mood to it. In particular, I imagine an off-frame torch that would spill some warm light into the scene. Let’s say it is somewhere behind the arc to the right. So we use the polygon selection tool to roughly

“nighty” solid layer selected and select the Gradient tool from the toolbar. Set it to circular gradient mode and drag out a large radius from our imaginary light off-screen. That makes our darkening filter partly transparent and allows the original image to shine through. Pretty cool, huh?

in reality, there would be some indirect light spilling into the shadows. So we have to put the spilled light in. Drop the selection, pick a large soft paint brush and paint a touch more transparency into the mask—very gently, with a flow setting of 10% or less. Also, you can use the Smudge tool to massage our mask so it better fits the background. That’s done with little strokes at a straight angle to the shadow lines, gently combing it over piece by piece. This has the additional benefit of softening the line; you can purposely soften it more by zigzagging across.

u OK, that corner is done. Let’s apply the same method to the little lamp on the other side. Sketch a rough selection with the Polygonal Lasso, and use it to paint some more transparency in our “nighty” solid layer.

i The final step is to add a touch of interactive light to that wall behind. Same thing again—restrict the painting area to a selection and paint within that alpha mask using a soft brush. Done.

Smooth sailing Admittedly, a similar technique might have worked in 16-bit mode as well. But it wouldn’t be as astonishingly simple and straightforward. We would need separate layers for the moonlight portions and warm light portions and all kinds of other trickery just to make it look natural again. Go ahead. Try to change the mode to 16-bit. I just did, and I can tell

5 After


216

Chapter 5

HDR Image Processing

217

1u

Repeat the workflow on the lantern.

i3

Adding a touch of interactive light.

1 e : Sketching a rough selection with the polygon tool.

t The shadow line is a little too hard now;

1r

A gradient in the layer mask lets the original image shine through.

had the solid layer bring it down again. In the figurative sense, we were winding up the dynamic range here.

1t

Adding some spill light and fitting the mask with the Smudge tool.

sketch out where the light would be hitting the walls.

r Make sure to have the alpha mask of our It’s all about the mood e The fun is just about to start, because now we’re going to add a little mood to it. In particular, I imagine an off-frame torch that would spill some warm light into the scene. Let’s say it is somewhere behind the arc to the right. So we use the polygon selection tool to roughly

“nighty” solid layer selected and select the Gradient tool from the toolbar. Set it to circular gradient mode and drag out a large radius from our imaginary light off-screen. That makes our darkening filter partly transparent and allows the original image to shine through. Pretty cool, huh?

in reality, there would be some indirect light spilling into the shadows. So we have to put the spilled light in. Drop the selection, pick a large soft paint brush and paint a touch more transparency into the mask—very gently, with a flow setting of 10% or less. Also, you can use the Smudge tool to massage our mask so it better fits the background. That’s done with little strokes at a straight angle to the shadow lines, gently combing it over piece by piece. This has the additional benefit of softening the line; you can purposely soften it more by zigzagging across.

u OK, that corner is done. Let’s apply the same method to the little lamp on the other side. Sketch a rough selection with the Polygonal Lasso, and use it to paint some more transparency in our “nighty” solid layer.

i The final step is to add a touch of interactive light to that wall behind. Same thing again—restrict the painting area to a selection and paint within that alpha mask using a soft brush. Done.

Smooth sailing Admittedly, a similar technique might have worked in 16-bit mode as well. But it wouldn’t be as astonishingly simple and straightforward. We would need separate layers for the moonlight portions and warm light portions and all kinds of other trickery just to make it look natural again. Go ahead. Try to change the mode to 16-bit. I just did, and I can tell

5 After


218

Chapter 5

HDR Image Processing

nominal exposure

- 6 EV

1e

Grab Kitchen_Window.exr from the DVD.

-4 EV

-2 EV

0

+ 2 EV

+4 EV

+6 EV

1r

Slide through the exposures and observe the lamp.

you it looks nasty! I refuse to print that here; you’ve gotta see it for yourself. And I gave up trying to repair it because either the shadows wash out or the moonlit wall turns flat, or the entire image becomes a mushy splotch. Notice how such things were not even a concern at all in this tutorial. Believe me, it gives you great peace of mind to have the extended range available at all times and never to have to worry about clipping or banding or precision issues. It’s also very convenient to think in terms of light being filtered and boosted instead of just assuming the pixels to be dry paint on a canvas. 5.1.2. Understanding the Color Picker In the last tutorial, I skipped over one step very quickly in the hope it would go unnoticed. I’m talking about the HDR Color Picker and how exactly the chosen color relates to what you see on-screen. Considering the fact that we are working in a wider dynamic range than our monitor can display, there’s not an easy answer.

e Let me explain that once again in a handson tutorial. The subject shall be our all-time favorite kitchen window, so please come along and pull it up from the DVD!

r First of all, let’s have a closer look at the ceiling lamp that’s just touching the top margin of the frame. Zoom in on the lamp and slide through the exposures. Watch how the pixels change their colors from orange to red to yellow until they finally blow out into white. I know—it’s tempting to assume we couldn’t precisely pin down the true color of a pixel. But that is not the case. In fact, the opposite is true. We can pick colors better than ever! Remember, what we are looking at is just a roughly tone-mapped representation of the image. We are looking through “8-bit gamma goggles”. Our HDR color values are transformed for display in the very same way a camera would take a JPEG snapshot. And if a real camera would take the +4 EV image, we would be well aware that the yellow halo is not the true color in that spot. When the Color Picker returns yellow, it is actually lying to us.

It’s just a very bright orange, too bright to fit in 8 bits. The same applies here, but with the difference that we can actually tell the true color underneath. We are not locked into the yellow false coloration. But we have to adjust the exposure for the spot we want to look at, and only then we can see the true color. You have to realize that this is an opportunity, not a disadvantage. Try to think of it like this: Our HDR image is pure light. What we see on-screen is a snapshot, taken with a virtual camera. The light itself surely has a definite color and intensity. But its appearance in the snapshot depends upon our exposure settings. It’s like virtual photography.

1e

The Color Picker looks different in 32-bit mode.

Examining light With that in mind, let’s see how Photoshop’s Color Picker works in HDR mode. It looks unusual at first, but it makes perfect sense once you get accustomed to the idea that HDR values describe light.

e The lower half shows the true light color underneath the pipette. Notice the Intensity slider just above the color field; this is our light intensity. Both values together describe the light that is in our HDR image. Now take closer look at the band of color swatches on top. The large center swatch shows how that light looks on-screen at the current exposure. Ergo, that is the on-screen color currently underneath the pipette. The additional color swatches are previews of how the same HDR values appear on-screen at different viewing exposures.

r You should really pull that image up to try it for yourself, just to get a feeling for it! Drag

1r

Drag the eyedropper across the image and watch the Color Picker.

219


HDRI Handbook Sample Tutorial