Tone Mapping in GIMP using the GEGL Operator fattal02

GIMP 2.8.0 includes a new – well, new to me anyway – GEGL operator called fattal02.  It’s named after the lead author, Raanan Fattal, of the 2002 SIGGRAPH paper,  Gradient Domain High Dynamic Range Compression.  (The other authors are Dani Lischinski and Michael Werman ) I have not read this paper yet, but I have visited the site at that link and have looked at their Belgium House photos.  Their resulting photo is very impressive.

I also found this page, Parameters for tone mapping operators, which describes a number of tone mapping algorithms – not the details of the their operation – but when they’re useful and the type and quality of their output.  It also describes the parameters that control the operation of the algorithm and provides hints on ranges of values that might produce the most promising results.

Frank Dürr’s page, Comparison of Tone Mapping Algorithms, is a very nice introduction to why tone mapping is necessary and shows the results of some of the tone mapping operators.  (Added 2012-08-22.)

I tried out fattal02 on this scene, which is, yet again, a slightly different crop of a photo that I’ve been using for a number of experiments.  My first inclination was to use the same starting photo that I had been using for my c2g experiments, but I’m running GIMP 2.8 on Fedora 17 running in a virtual machine.  It works, but is by no means very fast.  Anyway, here’s the photo upon which I conducted my experiments:

Below is the result that I got by using Alpha=0.10, Beta=0.90, and Saturation=0.80.  I tried other values for Alpha, Beta, and Saturation that were close to these values, but only saw subtle differences in the output – sometimes, the differences were so subtle that I couldn’t see a difference.  I also tried a few values that were farther away, but the output was not as good, in my opinion.

I find it interesting that the color near an edge is either lighter or darker, depending on where it is, and then becomes either darker or lighter away from the edge.  The sky, for example, is pretty dark, but it lightens up considerably around the buildings and trees giving them a halo.  The walls of the building, on the other hand, are lighter in color, except near the edges where they generally darken.

I tried playing with this scene using the Curves tool after running fattal02, but I couldn’t do much with the whole scene.  The point of tone mapping, in some instances anyway, is to decrease the dynamic range of the image so that details can be seen on displays which also have a limited dynamic range.  This is definitely what happened here.  This is the histogram shown by the Curves tool:

I also tried selecting the sky by color, but this proved very difficult to do, in the fattal layer anyway, due to the fact that the color of the sky ended up being somewhat close to other colors in the scene.  However, it’s relatively easy to select by color in the original scene.  When I do that and play with the curves for one of the fattal02 layers, I can lighten the sky up like so:

There are two other tone mapping operations provided by GEGL, mantuik06, and reinhard05, but my early attempts at using them produced no useful results.  But, to be fair, I had not yet found the page which describes how the parameters should be set.