Faking HDR in Gimp

One of the images I created using this method
So, this is the entry that has taken me over a month to write, for multiple reasons. A reader asked if there was a way to do HDR images in Gimp, and the short answer is No. The long answer is that a lot of people have tried to fake it (there’s actually a gimp script you can find here that will do it for you), but it seems the ones I have found have either giving you a “crazy color pop” effect (which is what the script I linked to above does) or an “increase the dynamic range” effect – much like the FX-Foundry script I talked about here.
This tutorial is going to try to merge BOTH of those effects into ONE photo. If you’re only interested in one or the other, I suggest you check out the approriate script above.
This method is adapted from this method on instructables. In fact, that method is shorter and probably less confusing, but the results weren’t exactly what I think of when I think “HDR”. That being said, the first half of my tutorial is almost exactly the same as that one, so if what I’m writing below seems a bit overwhelming, you might want to try following that one a few times first.
So. First. I assume that you either have three images – one that’s exposed “properly”, one that’s underexposed and one that’s overexposed – either because you took three actual images at different exposures or because you’ve used the exposure slider in ufraw (or the RAW editor of your choice) to produce those three images (which is what I did).
Here are my three photos:

underexposed

overexposed

"properly" exposed
Now, I open up all three in Gimp as multiple layers in the same photo and order the layers as so:

By the way, perhaps I’m admitting something I shouldn’t here, but it took me a bit of a while to figure out how to open up multiple photos in one image in Gimp. As I mentioned above, I’m converting from RAW here using UFRaw, so each time I press “OK” in UFRaw to open it in Gimp, it creates a separate Gimp window. So I copy and paste from there into my original file in the other Gimp window. Then, the key is, you have to press the “new layer” icon at the bottom of the layer dialog box (it looks like a piece of paper). If you have your three separate images already (outside of Gimp), you can drag them from the file system into Gimp, and it will automatically create each of them as separate layers.
Anyway, notice that I have my “properly exposed” layer (which I labeled as just “exposed”) at the bottom with my underexposed image on top of that and the overexposed image at the very top. For now, let’s make the overexposed layer invisible so that we’re looking at the underexposed layer.
Remember I’ve talked about Layer Masks before – the general idea is that you add a layer mask to one of your layers, and then if you paint black on that mask, that part of the layer will be transparent and if you paint white on the mask, that part of the layer will be opaque. So, the idea here is that we want the dark parts of this layer to be transparent (we don’t want to see them – we want to see the “exposed” layer below it instead), and the lighter, exposed parts (like the sky in the upper left) to be opaque.
The way we’re going to do this is by creating a duplicate layer of the underexposed layer (I know this might not make sense at first, but keep reading, I think it’ll all come together for you in a minute). Now desaturate it (I just used the default Colors –> Desaturate). When I first did this, the sky was still pretty gray in my photo, and since I really want to see the sky from this underexposed layer, I fix this by adjusting the curves (you can do this with Levels, too – whatever you’re more comfortable with, just play with it until you get the parts of the photo that you really want from your underexposed photo to be pretty white instead of gray). This is what my black and white layer looks like:

underexposed as black and white
Now, we want to turn that into the layer mask on the underexposed layer. So, select all of the black and white layer (by going to Select –> All or just hitting Ctrl+A), and copy it, then go back to the “under” layer and right click and Add Layer Mask (just pick whatever option it defaults to when it pops up, you’re just going to turn it into your black & white image anyway). Now, with the layer mask selected hit paste (Ctrl-V). Notice that you get this “Floating Selection” layer. Right click on it and select “Anchor Layer”:

And now it turns that into your Layer Mask! Now we don’t need that “underexposed copy” layer anymore, so you can right click on it and delete it. When you do that, you can see the results of your layer mask on the under layer. Here’s what my Layers look like now:

… and here’s what my image looks like now, (as a reference, that’s the original “exposed” version below it for comparison – notice the difference in the sky in the upper left):

With the underexposed layer mask

"properly" exposed
Now let’s concentrate on the overexposed layer and make it visible again. We want to do the opposite with this layer as we did with the underexposed layer. We’ll start off by duplicating the layer and desaturating it, which looks like this:

Desaturation of the overexposed layer
Now, if we were to turn that into a mask, the overexposed sky would be visible, instead of the nicely-exposed area on the right. That’s not what we want! In fact, that’s the opposite of what we want. So, everything that’s white we want to turn black and everything black, we want to turn white. Luckily, there’s a menu item that does just that. Go to Colors –> Invert and now it looks like this:

Inverted!
Now, we’ll turn that into a layer mask just for the overexposed layer just like we did the underexposed layer mask: Copy layer, create layer mask on overexposed layer, paste, anchor layer, then delete the black and white layer. Now our photo looks like this (compared with “exposed” again – notice how there’s more detail in the door area on the right):

Both under- and over-exposed layers have masks

"properly" exposed
Well, more of the photo is exposed properly now, I guess, but it still doesn’t “pop” like I want it to. Note: This is where my tutorial differs from the instructables one. This is also where I start having trouble describing what I’m doing, so if you’re not following along, PLEASE ask questions. So, I’m going to create a duplicate layer of both the underexposed and overexposed layers. So now my layers look like this:

If you’re doing this yourself at this point, you might notice that the photo changes appearance when you do this – I’m not posting that change in look here, since that’s not my final goal here, I want to play with those duplicate layers first. I’m going to change the blend mode of the underexposed copy layer (so, of the two underexposed layer, the one on top) to Burn and the blend mode of the overexposed copy layer (the layer on the very top) to Dodge. Now, start playing with the opacity of all four layers (all but the “exposed” layer, that is). I can’t give you some magic formula here, because I’ve done this a couple times on a number of different photos and I like something different each time. But I will tell that for THIS photo my layers (from top to bottom) are at:
- overexposed copy – dodge – 100%
- overexposed – normal – 75%
- underexposed copy – burn – 100%
- underexposed – normal – 75%
And now my photo looks like this:

After adding the Dodge and Burn layers and adjusting opacity
I’m still not completely happy with it, but it’s getting closer. Now I make a new layer from visible (found under the Layer menu) and make sure it’s at the top of all my layers:

First I go to Colors –> Hue-Saturation and bump up the saturation, and then I sharpen the photo and I end up with this as my final Fake HDR Photo:

My interpretation of fake HDR
I really don’t know what you guys are going to think of this, because honestly? I don’t like it! Which is probably another reason it’s taken me so long to write this entry. I confess: I don’t like most HDR photos! I think it’s one of those things that a lot of people like, and a lot of people don’t like, but whether you like it or not, it exists, and it’s popular, and so it can’t be ignored, which is why I really did my best to duplicate it the best I could here. When I think HDR, I think of the following things: No overexposed or underexposed areas of the photo, bright colors that pop, and a somewhat cartoon-y feel to them. And I guess the photo you see above has all of those things?
I tried this tutorial on a few other photos. Sometimes it turned out pretty good (like the photo you saw at the top of this entry – I actually really like that photo)
Sometimes it turned out really bad:

Yeah, this is kinda scary looking, actually.
I think it was all the thin branches in that one that really threw the whole thing off.
Anyway, if you try this tutorial, let me know what you think – I won’t be offended if you hate it, I promise. If you like HDR photos – do you think this is an ok interpretation of it?
Related posts:
- Using G’MIC to Create Vignettes In late 2009, I wrote a post about adding a...
- A Quick Portrait Editing Trick This is one of my quick tips that I haven’t...
Related posts brought to you by Yet Another Related Posts Plugin.
-
Thereminix
-
Jafael
-
Abhilash Kumar
-
iffles
-
Brandon
-
iffles
-
Shotslot
-
Abhilash Kumar
-
Shotslot
-
iffles
-
Yogendra
-
Abhilash Kumar
-
iffles



