Enfuse – multi-exposure blending and a proper HDR

In a comment on my previous post about HDR, Felix Hagemann recommended Enfuse as an alternative to HDR. Enfuse doesn’t require to build a “real HDR” image that you tonemap afterwards. Instead it blends together images that are exposed differently – a lot more simple and direct. Let’s see what the results can be and compare them to proper HDR and “mere” RAW processing.

Building Enfuse – the tricky part

Enfuse is part of Enblend and at beta stage. The version of Enblend included in Hardy Heron doesn’t include Enfuse, so compilation, here we go. wiki.panotools.com has a very good and complete howto build Enblend on Ubuntu (and others).

After installing a gazillion dev dependencies, the howto warns that “The second make step can be very long and memory consuming. Make sure you have enough swap space, and go get a healthy snack while the computer is compiling. ”

“Make” actually nearly killed my computer, gobbeling up RAM, filling swap space, everything became irresponsive and after two hours, it was still swapping like mad. So I killed the compilation and restarted it in console mode. 5 minutes later, lo and behold, Enblend was built, including Enfuse. Xorg and the Gnome stack use a bit of resources, apparently…

Bracketing images

Since Beka commented in my previous entry about HDR that you can’t do proper HDR without bracketing your shot (ie developping the same RAW file with different exposures doesn’t cut it), I decided to do the proper thing and walked through Geneva armed with my tripod – I felt more embarrassed than pro, if you ask me.

Anyway, I setup my camera to do a bracketing of -2; 0 and +2, using shutter-priority and took a few (semi-)decent shots which I processed with UFRAW standard parameters (no correction).

Enfuse version

I then had the 3 files processed by enfuse with a simple:

enfuse -o final_file.jpg file1.jpg file2.jpg file3.jpg

Enfuse prints out a few numbers on the terminal and spits a final_file.jpg which is a blending of the 3 differently exposed files. Here are 2 examples from my “tripod trip”:

The above is in the Parc des Bastions in Geneva, where the Reformation Wall is.

This one is the Jeremiah statue by Rodo that is just next to Geneva Cathedral. I have been fascinated by this statue and never really managed to photograph it in a way that satisfied me, partly because the statue is quite dark (and in the shade) against the clear and sunny Cathedral with luminous sky.

Too much DR for a camera sensor and a perfect test for “enhanced dynamic range” …

HDR (Qtpfsgui) version

Since I had the bracketed images to do a proper HDR, I had a go at it with Qtpfsgui. I won’t bother posting all of the different version for all the different algorithms this time, but here are the versions I prefer from playing with different settings.

For the record, the bastions image uses the Reinhard05 algorithm while Jeremiah is processed with Mantiuk.

What about RAW processing?

Just to make sure I tried everything, I fired Rawstudio and tried to get the best possible outputs from the (correctly exposed) RAW files. Indeed a RAW file has quite some more DR than a JPEG from camera and a good use of the curve tool can give a great output. Here are the results:

I am amazed how many time when shooting “casually” (ie without a tripod) I come across a DR that is beyond what my camera can capture; and I am amazed that I had a hard time finding “large DR” images when walking about with my tripod.

I thought the dark tree trunks vs the sky would be far more DR than what my camera can handle and it wasn’t. Granted, Jeremiah came out pitch dark against the sky background, but again, touching up the shadows did a good job.

A few words of comparison

So what do we end up with? 3 different ways to achieve different results all with the goal to enhance DR. Let’s just sum up what can be learned from this simple experimentation – not a scientific testing…

  • Enfuse: quick and easy processing, at least once you have the bracketed shots. Not a great amount of DR gain, though – Jeremiah is pitch black…
  • HDR: more complicated processing: bracketed shots, making an HDR file and tonemapping it. Gives an infinite amount of DR but also a funny / weird / special (lovely?) look.
  • RAW processing: just one shot and a reasonable amount of post processing. The curves tool gives a great result and if you don’t push it too much, you keep the noise acceptable in the shadow and an overall natural look. Masking can also do wonders, but is a lot more time consuming. However the amount of DR available is limited.

A last word about HDR

I have been giving some more thoughts to this HDR thingie – I even watched Flickr HDR images as a slideshow for a bit, something that I would qualify as “an experience”.

All in all, I would put HDR in the same bag as “‘toshop filters”, I mean “Gimp filters”: if you know what you are doing, if you don’t abuse it and (probably) if you plan your shot with a specific filter in mind, you can achieve great results. If you plan your image for an HDR look, it will look great, like the Cambridge in Color gallery.

But trying to save a so-so image with a water color filter, a solarization filter or with HDR will not save it: it will kill it.

7 Responses to Enfuse – multi-exposure blending and a proper HDR

  1. Well, if I would have to rank the results, it would be

    1.- Rawstudio
    2.- enfuse
    3.- HDR

    The HDR version seems to me too flat, too desaturated. It is as if there is a slight grey shade all over the pictures. The Rawstudio version is also a tad desaturated but in a way it adds to the picture. I think that is due to the fact that the shadow areas show now detail. In contrast they are in the enfuse version almost totally black which clashes a bit with the vivid colours.

  2. NewMikey says:

    I know you cannot do proper HDR with one RAW file but you can improve the quality of the RAW file immensely with the help of enfuse. Have a look at this bash script I wrote and tried out this morning after finally getting enfuse to compile:

    ——————————————————————————-
    #!/bin/bash
    FILE=”$1″
    FILE_NO_EXT=${FILE%.*}

    ufraw-batch –wb=camera –saturation=1.2 –exposure=0 –black-point=auto –overwrite –out-type=tiff –out-depth=16 –output=$FILE_NO_EXT-0.tif $FILE
    ufraw-batch –wb=camera –saturation=1.2 –exposure=-1.5 –black-point=auto –overwrite –out-type=tiff –out-depth=16 –output=$FILE_NO_EXT-1.tif $FILE
    ufraw-batch –wb=camera –saturation=1.2 –exposure=1.5 –black-point=auto –overwrite –out-type=tiff –out-depth=16 –output=$FILE_NO_EXT-2.tif $FILE

    enfuse -o temp.tif $FILE_NO_EXT-0.tif $FILE_NO_EXT-1.tif $FILE_NO_EXT-2.tif

    convert -normalize -unsharp 2×2+2.5+0.04 -quality 97 temp.tif $FILE_NO_EXT-autobracket.jpg
    rm -f $FILE_NO_EXT-?.tif
    rm -f temp.tif
    —————————————————————————–

  3. NewMikey says:

    Forgot to mention that for anyone having trouble getting enfuse to compile due to glut library issues, look no further! The solution was posted here http://on-idle-moor.blogspot.com/2008/01/bug-glew-and-mesa-glut.html

    It involves deleting one line from /usr/include/GL/glew.h like so:

    The obvious solution is to delete the #undef at line 10767 of glew.h. Here’s the trivial patch:

    — glew-1.5.0/include/GL/glew.h 2007-12-28 03:09:49.000000000 +0000
    +++ glew-patched/include/GL/glew.h 2008-01-26 11:45:27.000000000 +0000
    @@ -10764,7 +10764,6 @@
    #ifdef GLEW_APIENTRY_DEFINED
    #undef GLEW_APIENTRY_DEFINED
    #undef APIENTRY
    -#undef GLAPIENTRY
    #endif

    #ifdef GLEW_CALLBACK_DEFINED

    The above solution was posted by We Are Dave and I am very grateful as I had already resigned to not being able to compile enfuse.

  4. jcornuz says:

    Hi Mike,

    Thanks for sharing this. Enfuse was a pain to compile for me because of the amount of memory and CPU it was gobbling.

    Take care,

    Joel

  5. Sendhil says:

    Thanks for the very informative article on a complex subject with pointers to resources!

  6. aleph says:

    You can definitely do great HDR from a single RAW file. It all really depends on how evenly lit your subject is. If it’s not too unevenly lit, you can get away with a single RAW file. However, if you’ve got great extremes of light and dark, with some parts of the image greatly under and overexposed no matter what exposure settings you use, then you’ll need more RAW files.

    To improve your results, I suggest you pass enfuse as many different exposures as possible from each RAW file. It will make for smoother gradations of tone and probably also a wider range (depending on your subject and the exposures you use).

    My final recommendation is that, from my own experiments, you usually only really need a maximum of three RAW files. One properly exposed, one underexposed while still revealing detail, and one overexposed while still revealing detail. I would hesitate to put precise numbers on these exposures, as it really depends on how your subject is lit. Also, there are a few really extremely lit subjects that might require more RAW files. It certainly does not hurt to use more, but it won’t necessarily help.

  7. dramcam says:

    As long as nothing is blown out, it is hard to beat a well edited RAW, especially with a good denoiser for the dark areas. I’d love to see an example of from anyone who claims HDR can do better than a single edited RAW. Yes I know the HDR theory, but overlapping images adds noise, not to mention noise from tiny image misalignment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: