Some usage notes

  • Bernhard Bablok

    Bernhard Bablok - 2010-11-04


    here are some basic usage notes - all of this should go into the documentation, which I will hope to finish in the next weeks.

    The main point about the modular structure of hdrff is that you don't have to run all modules at once. So a typical workflow could look like this:

    > hdrff baseModules

    Note that this is identical to running

    > hdrff copyFiles name2lc fixDate setRO jpg2tif raw2tif findGroups

    At this point you could examine the files in $IMG_DIR (which defaults to $TARGET_DIR/work) and discard all images you don't want to keep. You would also edit the file $HDR_LIST (which defaults to $IMG_DIR/hdr-list.txt). If you delete images, you should also delete them from the HDR_LIST. If the module findGroups identifies wrong image sequences: here is the place to fix them.

    Next, you go on with some additional modules. Assuming that you set IMG_FIXCA=1, and  IMG_PREFIX=dsc_ you would run

    > hdrff fixCA
    > DEL_FILES="dsc_" hdrff delInterFiles
    > hdrff alignImages
    > DEL_FILES="ca_" hdrff delInterFiles
    > hdrff enfuseImages makeHDR
    > DEL_FILES="ais_" hdrff delInterFiles
    > hdrff tmMantiuk tmFattal tmDrago makeGIMP
    > DEL_FILES="fattal_ drago_" delInterFiles

    Note that running delInterFiles with different configuration allows you to remove intermediate files at the point when they are processed and not needed anymore. If you have enough disk-space, you can run delInterFiles at the end and configure DEL_FILES into your hdrff.conf. You could also remove the hdr_-files and enf_-files.

    Finally you could move your results to the archive directory:

    > hdrff setOrigDate mv2Archive

    The module setOrigDate is only necessary if you want to set the date of all generated files to the date of the original image.


  • ElliottCB

    ElliottCB - 2010-11-09

    Sali, Bernhard. Thanks for the clarifications. I'm starting to get my workflow sorted out now. I just had an A-Ha! moment - I think you should know about it. The EXIF data for Nikon NEF files contains a value called "Exposure Bracket Value". These will only ever exhibit 2 patterns when I do an unbroken HDR bracket series: { 0, -1, 1 } or { 0, -2, -1, 1, 2 }. This suggests to me that, at least for Nikon, there is an absolutely reliable way automatically to recognise the bracket groups that won't be fooled simply by shooting a fast series of ordinary shots.

    I'm still getting used to the horrible syntax of Bash scripting but I'll get around to implementing a grouping algorithm on this basis in due course. (I'm a C++ guy.) If you don't want to wait, I think it would be a useful enhancement.


  • Bernhard Bablok

    Bernhard Bablok - 2010-11-09

    Hi Elliott,

    currently, I am busy with the documentation. But here are some hints, since I did implement something similar already for a predecessor of hdrff.

    I think the code should go into something like a "findGroupsByBracket"-module. Since we have no polymorphism in bash, we could use instead code like this to support more than one image-type:

    # test some bracket-code
    # --- bracket-mode for NEF ----------------------------------------------
    isBracket_nef() {
      # NEF: shooting-mode single: 0x00, continuous: 0x01, 
      #      bracket: 0x10, timer: 0x02, IR: 0x80
      local bracket=`exiftool -s -s -s -n -shootingmode "$1"`
      let bracket=$bracket\&0x10
      echo $bracket
    # --- bracket-mode for MRW ----------------------------------------------
    isBracket_mrw() {
      # MRW exposure-mode: single: 0x00, bracket: 0x02
      local bracket=`exiftool -s -s -s -n -exposuremode "$1"`
      let bracket=$bracket\&0x02
      echo $bracket
    for f in "$@"; do
      bracket=`isBracket_$IMG_EXT "$f"`
      if [ $bracket -ne 0 ]; then
        echo "$f within image sequence"
          echo "$f is single image, no sequence"

    You can paste this into a file and pass filenames as arguments.

    That's the first part. We would need a function for every supported image-type.

    The next problem is to find the end of the sequence. Your proposition about the patterns is not correct, there are more possibilities (e.g. I have an examples with {0,-2,+2} and {0,-2} - at least the D80 allows sequences of only two images, and the values also depend on "auto bracket order" which could be "0,-,+" or "0,+,-".

    And that's only nef ;-) But it should be possible to nail down sequences this way. Other manufactures add a field with the sequence number of an image within a sequence, that is a bit easier.

    My implementation only used the bracket-code above and the datetime-values, which was good enough for me. Even with "Exposure Bracket Value" I would not safely identify all of my sequences, since sometime I change exposure-values manually (the D80 only allows 2 or 3 images per sequence).

    If you have some working code, you can post it and I will have a look at it.

    Good luck, Bernhard

  • ElliottCB

    ElliottCB - 2010-11-10

    Hi, Bernhard,

    Yes, there are a few ways the pattern can deviate from my own series. The size (in ev) of the bracket can also be altered. I imagine there is a camera somewhere that takes the brackets in numeric or reverse-numeric order. However, I should have thought the following conditions must hold:

    1. A valid group will not contain two instances of the same Exposure Bracket Value. A group should always terminate at the first repeat.

    2. A valid group will have a small interval between exposures, even if the exposures themselves are long. The exposure time difference minus the exposure duration will yield a value typically less than 2 seconds for a valid group.

    Further, the following MAY hold and should be a configuration option:

    3. The shooting mode will be automatic.

    Grouping by 2 (several seconds) followed by 1. ought to catch most instances of a valid group, I would hazard.

    I'll have a stab at coding a first version over the weekend and send it on to you.

    Best wishes…


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks