Over the years my photographic attempts have become increasingly ambitious, and I seem to have developed a particular fondness for HDR panoramas of the Southwestern US. If you've ever tried to compose such masterpieces yourself, you might have noticed that it's quite a time-consuming task. I therefore decided to speed things up by automating the process as far as possible - the work should be done by the CPU, not by me. The result is a set of Perl scripts that facilitate the generation of HDR images and HDR panoramas. I'm perfectly aware of the fact that a lot of people have created such scripts before, but I didn't find any providing the following features:
- sort a bunch of images into directories, each containing one HDR triplet or one HDR panorama (script hdr_identify_panos, it works by looking at the capture time of each image and even takes into account the exposure time [important for night shots])
- on such a collection of images or directories, you can now run hdr_create. It will:
- align the N exposures of each image using
align_image_stack
from the hugin project in case they're not completely congruent. - combine the N exposures and perform the tone mapping using Photomatix running in wine
- create a Hugin config file and run Hugin, if it's a panorama
- the geometry information of this panorama is then used to render a configurable set of other Photomatix tonemapping presets: I noticed that depending on the image, different presets yield the best results. So I render them all and choose afterwards (let the CPU do the work)
- in general, it works best to first create a tonemapped JPG from each frame in a panorama and then stitch them together in Hugin, so that's what my script does. However,
- in certain special images (like this one) the only way to get a decent panorama is to load the EXR images into hugin and then tonemap the stitched EXR. My script creates an exr folder that holds all necessary files and a Makefile that you just need to run to created the stitched EXR which you can then tonemap using hdr_create -e (I'm not doing it because it takes quite some time and isn't necessary very often)
- all tasks (aligning the pictures, creating the EXR, tonemapping, rendering the panoramas) are fully multithreaded, taking advantage of modern multicore CPUs
- possible input file(s): N JPGs, N CR2s (Canon raw), 1 CR2 (pseudo-HDR) or an EXR file using the -e switch
- the EXIF data of the images is preserved during the whole workflow
All Perl scripts and additional files can be found on GitHub
Please let me know if you've got any comments or improvements regarding this project.
a 2024 daduke production. all rights reserved.