User Tools

Site Tools



Mac OS X software for HDR capture using Canon cameras. Originally created in 2006 by Greg Ward (Anyhere Software), re-worked/updated by Dr Denis Fan (IESD, De montfort University).

June 2016 Note

Unless you have legacy cameras and older versions of OS X, you may want to try something else, e.g. gphoto2.

November 2012 Update

'Current' version of HDRcapOSX (v2.1, October 2011) works with OS X 10.8.2 - single test with a Canon EOS 400D, 550D and 600D. Please report any success/failure that you experience noting camera model and version of OS X: John Mardaljevic.

October 2011 Update

HDRcapOSX now works with OS X 10.7 (Lion) and Canon EOS SDKs 2.9 and 2.10. See Version History.

Denis Fan has (once again!) updated HDRcapOSX. The update was compiled under 10.6.8 but seems to work under 10.7.2. Testing has been limited so please report successes and failures to John Mardaljevic - include camera model number in any reports. HDRcapOSX Version 2.1 was (briefly) tested under 10.7.2 with a Canon EOS 400D and seemed to work fine.


October 2011 update HDRcapOSX-2.0-2.1.tgz

April 2010 update HDRcapOSX.tar.gz

Automatic capture instructions

How to automate capture using a Mac Mini less k/b and screen

This is for situations where you wish to simply leave a Mac Mini and camera at some location to capture HDR images at some fixed interval, e.g. every 10 minutes, every hour, etc. Furthermore, it's for those times when you'd rather not bring a screen and keyboard just to set the process off.

In other words, you simply power up the Mac Mini (and camera) and leave it to capture until it is either switched off or a pre-set shutdown command is given.

The method we worked out uses cron to execute the capture. Not perhaps the most elegant method, and could no doubt be improved, but it seems to work OK with minimal configuration.

The following script do_hdrcap is executed by the cron at regular intervals and launches the canoncap capture script (part of the standard HDRcapOSX install).

#!/bin/csh -f

set t = `date "+%y%m%d%H%M"`

/Users/full-path-1/canoncap   /Users/full-path-2/$t.hdr

Note, cron does not have access to your PATH variable, so it will not necessarily find the canoncap script if the full path is not given. Similarly, you need to give the full path to the directory where you want the HDR image to be placed. In all the examples here, replace full-path-1 etc. with the full path to the file/script for your particular system. The do_hdrcap script will execute canoncap to create a HDR image with the filename, say:


which is the time-stamp for the moment of capture – format YearMonthDayHourMinute.hdr (last two digits for Year). The script could easily be adjusted to skip the capture command for certain hours, say darkness, if the capture period was to extend over several days.

The entry to the system cron file should look something like this:

  */10	  *	*	*	*	/Users/full-path-3/do_hdrcap

This would execute do_hdrcap every 10 minutes, i.e. 10, 20, 30, etc. minutes past the hour. The cron command can be made inactive by inserting a hash sign (#) at the first character of the line, i.e. commenting it out.

You may need to soft-link hdrgen to some location where it can be found by the cron-initiated process, e.g:

sudo  ln -s  /Users/full-path-4/hdrgen  /bin/hdrgen

You'll need to make two minor edits to the canoncap script. First, add the following line just after the comments at the head of the file:

killall CanonHDRcap 

This is just in case a CanonHDRcap process is left hanging around from a partially executed capture when the Mac Mini boots up. Next, comment out the line that starts the Photosphere process, e.g:

#open -a PhotosphereU $outf

since we don't want this launching on a screen-less Mac.

Lastly, you need to configure the Mac Mini so that automatic login is enabled – this is because I couldn't get the process to work without a user logged in. Evidently, you don't want to be doing this using a computer that has any kind of sensitive and/or valuable data on it since anyone connecting a screen and k/b will have full access to that login (and much else depending on the permissions). Automatic login is enabled through the account preferences. The safest approach is to (automatically) login to an account with limited privileges. Ensure however that there is always another login account with administrator privileges that you can access to switch-off the auto login etc.

If you've done all the above, it should then be a simple matter of plugging-in the Mac Mini with tethered and (preferably) mains-powered Canon camera set for usual HDR capture. Then, powering-up the Mac Mini should result in the capture starting automatically at the times set by the cron entry without any need for a screen or commands entered via a k/b.

Let me know if you:

  • Get it working and make use of the approach; and/or,
  • Can figure out a more elegant way of achieving this or similar functionality.

John Mardaljevic.

Version history / README

October 2011

The CanonHDRcap is now available in two versions: 2.0 and 2.1. Note that all camera cannot be used with 10.5.6 and EOS %d cannot be used with 10.5.1 and 10.5.2 (based on Canon API's documentation).

(a) Version 2.0

This version has been updated and supported under Canon EOS SDK version 2.9. The package has been compiled under Mac OS X version 10.6.8 (Snow Leopard) as an universal binary, BACKWARDS compatible up to Mac OS X version 10.4.x (Tiger). Compatible to latest camera model up to EOS 60D, NOT EOS 600D and EOS 1100D.

(b) Version 2.1

This version has been updated and supported under Canon EOS SDK version 2.10. The package has been compiled under Mac OS X version 10.6.8 (Snow Leopard) as an universal binary, BACKWARDS compatible up to Mac OS X version 10.5.x (Leopard). Compatible to latest camera model up to EOS 600D and EOS 1100D.

April 2010

The CanonHDRcap is now updated and supported under Canon EDSDK version 2.8. It has been compiled under Mac OS X version 10.5.8 as an universal binary, backwards compatible up to Mac OS X version 10.4.x.

Note that Canon EDSDK version 2.8 is now supported for 10.6.x, and CanonHDRcap should be able to work under Snow Leopard. Feedbacks from users under 10.6.x are most welcome. Unfortunately, the current version of CanonHDRcap does not work under 10.6.x (Snow Leopard). You may also have difficulties using some of the more recent Canon cameras under 10.5.8.

May 2009

The CanonHDRcap is now updated and supported under Canon EDSDK version 2.6. It has been compiled under Mac OS X version 10.5.7 as an universal binary, backwards compatible up to Mac OS X version 10.4.x.

September 2008

The aperture size is not set to 4 by default.

Modification (b) and © below would only work properly if camera models are released after the Canon 30D. In the case when camera models are detected as one of the previous models before the Canon 30D, the modification will be disabled.

July 2008

Greg Ward's HDRcapOSX has been largely re-written to accommodate the changes in Mac OS X and the Canon SDK since the original version appeared. The re-write was carried out by Denis Fan and supported by EPSRC grant EP/E027148/1.

The CanonHDRcap is now supported under the Canon EDSDK version 2.4, and has been compiled under Mac OS X version 10.5.4 as an universal binary, backwards compatible up to Mac OS X version 10.4.x.

Some modification of the CanonHDRcap are described as follows:

(a) The aperture size by default is set to 4 when it executes; (b) LDR images are downloaded after the sequence of captures, rather than during the sequence; © The ability of downloading both jpeg and raw data from the camera after the sequence of captures. If you use this option, by default canoncap would only execute hdrgen to generate the HDR image using the jpeg sequences.

Otherwise, the operation is as described in the original notes below.

Feedback etc. to:

Denis Fan
Institute of Energy and Sustainable Development
De Montfort University
The Gateway


A suggested acknowledgement is:

Software originally created by Greg Ward (Anyhere Software) and sponsored by NYSERDA through the Lawrence Berkeley Laboratory. Re-write by Denis Fan (De Montfort University, Leicester, UK) supported by EPSRC grant EP/E027148/1.

January 2006 (Pre DMU update)

HDR Capture Utilities 0.9 01/24/2006 Greg Ward with help & sponsorship (see Acknowledgements)

I have put together a few utilities that should make HDR capture a little easier, especially for Canon EOS cameras. There are three directories in this distribution:

app/ Canon HDR capture application and control file bin/ C-shell scripts and PPC executables doc/ Some HTML documentation

Instructions for all users

Put the files in the bin/ directory either in /usr/local/bin or your own bin directory – someplace in your execution path. The hdrgen program should be familiar to you already, but for information, consult the included hdrgen.html document. Below is a brief description of the other programs:

canoncap - C-shell script to manage Canon HDR capture & conversion dcraw - David Coffin's RAW image converter, needed by raw2hdr raw2hdr - C-shell script for RAW → HDR merging

The canoncap script is not really relevant, unless you are one of the…

Canon EOS users Move the contents of the app/ directory someplace sensible, such as /Applications/Utilities or somewhere under your home directory. You will need to edit the CaptureParams.txt file, which needs to live in the same folder as the CanonHDRcap application.

Edit the CaptureParams.txt file with a text editor. If you want to save all the images you capture, make sure the second line is set to 0. If you would rather not have these files left around (and you don't own an EOS 300D camera), set this to 1 to clean up LDR files afterwards. Then, choose an output directory and base file name for your images, which will have a 4-digit number and extension added to them. If you like, change the search f-stop step, which indicates the spacing between exposure times as CanonHDRcap looks for the first useful exposure. If the search step is set to 0, then it will use the current speed setting as the fastest, and work down from there. If the search step is set to -1, then the sequence will begin at the fastest available shutter speed, whatever the lighting conditions. The next line (f-stops between captures) indicates the spacing for the actual sequence, with the final setting beingthe number of captures to take.

You will need to set the camera in “manual” exposure mode, and you should fix the white balance to match your scene and choose an aperture that allows a slightly underexposed image at the fastest shutter speed, or wide open for darker scenes. You can capture either JPEG images (preferred) or RAW, but not both. Also, you may get better results if you turn off autofocus. Obviously, you'll want to mount the camera on a tripod – if you just set it on a table, an SLR will tend to shift from its mirror action. Connect the camera to the Mac via its USB or Firewire connector, and off you go. Be sure to set it in the “PC connect” mode, not PTP, which is for printers and doesn't function for remote control applications. Double-click on CanonHDRcap from the Finder, or use the canoncap script described below.

The “canoncap” script runs CanonHDRcap and hdrgen/raw2hdr for you from the command line, but you need to edit the script first to set the appropriate installation paths according to where you've put things. Open canoncap with a text editor, and alter the “set respf=” and “set capapp=” lines appropriately. The first sets the location of your camera's response file, which will be created the first time you run the script. From the command line in a Terminal or xterm window, run:

canoncap {output.hdr}

to capture your image. Just like raw2hdr and hdrgen, you can actually output to any number of HDR formats, as determined by the suffix on your output file:

.exr	- OpenEXR format (large, highly accurate)
.tif	- LogLuv TIFF (more compact, accurate)
.hdr	- Radiance RGBE format (compact, reasonably accurate)
.jpg	- BrightSide's JPEG-HDR format (very compact, less accurate)

I have found RAW captures to be problematic for HDR capture, resulting in pink areas that seem to be caused by the default highlight normalization in dcraw. I'm not sure how to fix this problem, but any hints would be appreciated.

That's it. Let me know if you run into problems.

Original pre-update acknowledgement (see above for recommended acknowledgement):

This work is sponsored by the Lawrence Berkeley Laboratory through a contract with NYSERDA. Please write to with questions or if you intend to use this in a publication and need wording for proper attribution.

The dcraw program is written by David Coffin, and provided free of charge. Please credit him if you use the raw2hdr script for converting RAW to HDR, as it is 99.5% his work and generosity that makes this possible.

Page Tools