Tuesday, July 04, 2006
qpfstmo: HDR Tone Mapping GUI for Linux
Why Tone MappingThe first two photos below are the shortest and longest exposures used for constructing the final HDRI. In the upper left image, to capture the sunlit details, the back fence and red chair are underexposed. The upper right image captures faithfully the color information for the chair and fence, along with the displayed image on the computer. But this is at the expense of the brightest parts in direct sunlight completely saturating the camera's sensor. As my earlier post explained, using six images spanning the dynamic range of the scene, a HDR image can be constructed.
f/8 at 1/400 sec
f/8 at 1/13 sec
Linear mapping from HDR to LDR
The lower left image tries to linearly map to the 8bits/channel availible in the standard JPG format. Eventhough it maintains strong color information in the midrange, both the high and low end details are completely lost.
The bottom right on the other hand uses a logarithmic mapping, which does a fine job of maintaining the shadow detail. The sunlit parts of the scene also preserve their detail. But this comes at the expense of the color information; the resulting image appears flat.
Tone mapping operators provide more sophisticated methods for acheiving the needed range compression. pfstmo provides seven such operators; along with references to the orginal papers for each operator. For further discussion, I recommend High Dynamic Range Imaging; Acquisition, Display, and Image-Based Lighting by Reinhard, Ward, Pattanaik and Debevec.
qpfstmoqpfstmo provides a Qt-based GUI for using the pfstmo binaries. Before proceeding, make sure you have a working installation of pfstools and pfstmo. Given that, get the source code via:
- Source tarball: qpfstmo-1.0.tar.gz
The download is from my public Comcast space, which is not always availible. Let me know if problems persist.
- CVS from pfstools' sourceforge pages:
cvs -z3 -d:pserver:email@example.com:/cvsroot/pfstools co -P qpfstmo
Web interface to CVS
There is nothing about this code that makes it tied to Linux. If you have Qt and pfstools/pfstmo installed successfully, you should be able to get this program to work.
Overview of using qpfstmoAssuming you have loaded an HDR image, the first thing to appear is the Main Window.
The across the top, there are Tabs for each of the seven operators included in pfstmo. Before any can be used, a "Work Size" must be selected. By starting with a small size, it is quick to see the effect of adjusting a parameter. To apply the selected tone mapping operator with the specified parameters, just press the "Apply", , button. You can choose to have the new mapped version replace the current image or have the new mapping open in a new viewer window.
The "Viewer" window. If you like what you see, you can save it. For this version, the only save option is as PNG. I am having issues with Qt's QString and file extentions. Gamma can be adjusted, and reset if needed.
Using the "New Window" option in Main window, each tone mapping will appear in its own window. This makes it easy to see what effect adjusting a parameter will have on the tone mapped image.
My favorite tone mapping operators:
- drago03: Simple and fast global operator. Good for getting a quick preview;
- fattal02: A gradiant-based local operator. Can do a nice job compressing large dynamic ranges. But also easy to generate the dreaded "halo" effect.
- reinhard02: Based on Ansel Adams work with the zone system. Automates the idea of "dodging" and "burning". It can be a little hard at first to understand the effect of the different parameters.
- durand02: Slow but powerful operator. Works by splitting the image into the slowing varying high dynamic range content and the low range detailed component. The main control is "Base Contrast".
By the way, you don't specify the license, I guess it is GPL? (as it is already on sf.net)
Is it planned to add make install so that packaging could be easier?
Maybe you could mentioned that it need qt-3* (with qt-4 it does not compile).
Anyway I already compiled on gentoo, it seems to work fine. It's just still a little bit complicated to fine good parameters.
Like this pfstmo makes really fun - more than using grapic tools on the command line which can be quite frustrating...
As result I always get images with a red touch. Any ideas?
ImageViewer::setImage:Failure to start
I'm using an openEXR file saved from cinepaint.
When I try to open an HDR photo (exr), I get the error "/usr/local/bin/pfsin: line 6: test: too many arguments". I imagine that is a pfstools error on my end, but I'm not sure. I compiled pfstools without imagemagick support, since I couldn't figure out how to inform it where the libraries are.
Thanks in advance,
Just dropping by to say that your program is awesome. Once again, it was a case of PEBKAC. I had to downgrade my ImageMagick(++) install from 9 to 6, and then I could compile pfstools with IM support, and then qpfstmo worked like a charm! Keep up the coding and the cool photos!
I've compiled qpfstools-1.0.0.
When I try to open a file, I get
TMDialog::loadInput:Failure to start
because loadproc->start() is not true in
"./tm_dialog.ui.h" line 418
This is a nice piece of software that actually enables one to experiment with pfstools and stuff. However, it seems desirable to have some sort of save button that will work with the native resolution rather than the work resolution which is usually thumbnail-sized. Of course one can just copy the parameters down and use the command-line tools instead, but it seems like a minor effort to provide that kind of functionality off from the gui itself.
Nice tool, working nicely on debian unstable, may be you could give a push for packaging by completing Makefile with install an uninstall unstructions.
Will back later with some of my search made using psfs suite and qpfstmo. Anyway first works appear very intersting.
La vie est pleine d'une infinité d'absurdités, qui, impudemment, n'ont
même pas besoin de paraître vraisemblables; car elles sont vraies.
should be alfa=0.01 beta=0.88 saturation=0.8
change in tm_dialog.ui.h
alphaGang = new Gang(alphaSlider, alphaLineEdit, 1e-3, 1, 1e-2, true);
betaGang = new Gang(betaSlider, betaLineEdit, 0.5, 1, .88);
saturation2Gang = new Gang(saturation2Slider, saturation2LineEdit, 0, 1, 0.8);
i do not get a list of available "Work Size"s.
i tried both the .tgz from your homepage and
a CVS-build. both have the same issue. any
ideas how/where to fix that? i'd really love
to test this tool, since it looks pretty cool
(from what i can tell from the screenshots).
What license is it under? If it's GPL can you include a copy of the GPL in the tar? Thanks for the great app.
The reflections on the top of the table in the picture look very nice!
I did update it for the new algorithms. Just never got it ready for mass distribution.
thanks for your work,
I'm here just to confirm that there's a problem on my machine with setting the work size = the control doesn't expand.
Well on my free time, I'll try to debug.
Nice to see something done so great.
BTW: you mentioned back in 2007 you are preparing new version of qpfstmo intended to work with pfstmo 1.1 (new algorhitms etc.). Is qpfstmo 1.0 (available for download in the article) that promised version or not? Thanks