To use my tool, I would have had to manually create roughly 100 directories and figure out the series of 3 images that belonged together to isolate them in those folders …Instead of spending hours doing so, I decided to spend one hour writing a script that would automate this task. So here it is !
The script will run three passes. One for JPG files, one for Canon CR2 files and one for Nikon NEF files.
It checks the images three by three to make sure the numbering is continuous, that the exposure mode is bracketed and that the three images belong together because the progression of the exposure bias is consistent (0 -2 +2, -1 -2 0, etc).
When such image series are found, the script will create a sub-directory HDRx (where x is a number that is incremented automatically) and move the images there. here’s a simple example of a run:
Analyzing JPG files
Checking if file IMG_0003.JPG is bracketed … NO
Checking if file IMG_0004.JPG is bracketed … NO
Checking if file IMG_0005.JPG is bracketed … NO
Checking if file IMG_0050.JPG is bracketed … YES
Checking if file IMG_0051.JPG is bracketed … YES
Checking if file IMG_0052.JPG is bracketed … YES
Checking if file IMG_0053.JPG is bracketed … YES
4 bracketed images found
Checking if images 0050 0051 0052 go together … NO
Checking if images 0051 0052 0053 go together … YES
IMG_0052.JPG |> HDR1 – Exposures: -1.5 0 1.5
Analyzing CR2 files
0 bracketed images found
Analyzing NEF files
0 bracketed images found
And voilà ! you end up with a folder HDR1 containing 3 images I can use to build an HDR image.
This is the default verbosity of the output. If you pass -q as a parameter, it will be totally silent. If you pass -v, it will be even more chatty 😉
If you have KDE installed on your system, you can use the -k option to have a graphical dialog showing progress.
I show here a simple example but I actually used the script on my vacation pictures and it created 93 folders and perfectly identified the series of 3 images ! Yeah me !
If you don’t trust the script will work on your images, you can invoke the -d option so it will only output the information but will not create folders and move files.
The latest version of the script can be downloaded from the attachments section at the left of this page !
Update (29 Sept 2009): updated the script to v1.1. See changelog in the script itself.
Update (19 Mar 2010): updated the script to v1.2. See changelog in the script itself.
Update (11 Aug 2010): updated the script to v1.3. See changelog in the script itself.
Update (20 Sep 2010): updated the script to v1.4. See changelog in the script itself.
Update (11 Nov 2010): updated the script to v1.5. See changelog in the script itself.
Update (06 Dec 2010): updated the script to v1.5.1. See changelog in the script itself.
Update (16 May 2011): updated the script to v1.5.2. See changelog in the script itself.
Update (06 Jun 2011): updated the script to v1.5.3. See changelog in the script itself.
If you like this script, feel free to leave a comment !
Optionally, if you’re running KDE, you can copy the attached .desktop file to the folder services/ServiceMenus of your kde4 install and you’ll end up with a contextual menu when you right mouse click on a folder from your file explorer …
On my machine, the file is /usr/share/kde4/services/ServiceMenus/vinceBrackets.desktop
If you run into problems or the script currently doesn’t support your camera’s files, you can send me an email at email@example.com and I’ll help you out.