Offline Batch Processing of

Multiple Images

HDR Shop 3.0 includes a small but powerful command line batch processing utility called 'rawTool'. Offline batch processing can be used for 2 functions:
1) Conversion of multiple files from any of the following input formats:

To any of the following output formats:

2) Assembly of HDR images from image sequences in any of the above input formats output in any of the above output formats.

The command line utility is called 'rawTool.exe' and can be found in your HDR Shop directory in the \plugins\imgConvert\ directory. If you open a command prompt and navigate to that directory and type 'rawTool.exe' you will be presented with the instruction list:

			  #==============================#  RAW converter built on...
			  | rawTool by Bruce Lamond 2008 |  Raw Photo Decoder "dcraw"
			  #==============================#  by Dave Coffin,

			  Usage: 'rawTool [options] file1 [ file2 ...]'

				 HDR assembly options:
		-hdr                   Assemble HDR sequence from files.
		-hdr_no_exif           Assemble HDR without using embedded exif
		-range < num> < num>   Usable pixel values range 0-1 (default 0.005-0.92)
		-pd                    Load RAW images as 3-channel float (SLOW!!)
		-sc < num>             Set fixed abs scale multiplier between images in sequence
		-scRGB < num> <1 1 1 r2 g2 b2 r3...>  Set sequence abs scale per channel
						num:images in sequence; r:scale r/r"

				 Converter options for all image formats:
		-r/-R                  Recursively convert wildcard files in all subdirectories
		-crop < l>< r>< t>< b> Crop the image (left/right/top/bottom) before saving
		-h                     Half-size color image (simple 1-2-1 blur kernel)
		-h_same_name           Half-size: don't append '[h]' to output filename
		-ow                    Over-write output image if it exists (default: off)
		-o "outFile"           Specify output filename (single input file only)
		-g < num>              gamma correct (0-16)
		-gFile "fname.m"       apply custom gamma curve
		-b < num>              Change brightness (stops)
		-exp                   Exposure compensation (Av x Av) / (Tv x ISO)

				 RAW converter options:
				 (All RAW options valid with HDR assembly options)
		-no_map0_1             Don't scale 0-65535(ushort) to 0-1(float)
		-no_autorotate         Don't rotate image based on camera orientation sensor
		-wba                   Use automatic (average whole image) white balance
		-wbc                   Use camera white balance, if possible
		-rwb < nums>           Set raw white balance (four values required - R G1 G2 B)
		-sbl < num>            Set black point
		-H [0-9]               Highlight mode (0=clip, 1=no clip, 2+=recover)
		-t [0-7]               Flip image (0=none, 3=180, 5=90CCW, 6=90CW)
		-oc [0-5]              Output colorspace (raw,sRGB,Adobe,Wide,ProPhoto,XYZ)
		-bayer                 Document Mode (no color, no interpolation)
		-bayer_unscaled        Document Mode without scaling (totally raw)
		-q [0-3]               Set the interpolation quality (3 default)
		-f                     Interpolate RGGB as four colors
		-B < domain> < range>  Apply bilateral filter to reduce noise
		-j                     Don't stretch or rotate Fuji super CCD images

				RAW info options:
		-v                     Print verbose messages
		-c                     Write image data to standard output
		-e                     Extract embedded thumbnail image
		-i                     Identify files without decoding them
		-z                     Change file dates to camera timestamp

				 Valid output file types:
		-pfm                   Default 32-bit PFM
		-exr                   16-bit(HALF) OpenEXR zlib block compression (3)
		-rad                   32-bit HDR Radiance format
		-png                   8-bit PNG
		-jpg                   8-bit JPG
		-bmp                   8-bit BMP
		-ppm                   8-bit PPM
		-tga                   8-bit TGA
		-tif                   32-bit TIF

* The 'HDR assembly options' are similar to those dialog options listed in the HDR Image Assembly tutorial.
* Most of the 'RAW converter options' are the same as the dialog options in the Importing RAW Images tutorial.

Example uses of rawTool.exe:

Drag and Drop shortcuts. Some predefined links have been included in the same directory to allow you to convert/assemble files by dragging them on to the link directly, avoiding the command line. To enable these links you should do the following:
Create an Windows environment variable called 'IMGCONVERT' which points to the directory where rawTool.exe resides. Add '$IMGCONVERT$' (note the dollar signs) to your Windows PATH. You can find information on how to perform these operations on the Internet. You should be able to use the link now.

A simple batch file generator is also included in the same directory as rawTool.exe. This command line tool can be used to automatically generate text files containing a very large number of custom commands. The tool is called 'batchGen.exe'. Type 'batchGen.exe' in the command prompt to see the list of instructions:

		      | batchGen by Bruce Lamond 2007 |

		      Generate batch files quickly.

		      Usage: 'batchGen \
		                -exe  \
		                [-o <"list of options">] \
		                -pfix  \
		                -st <00..n> \
		                -end  \
		                [-step ]\
		                -sfix  \
		                [-opfix ]
		                [-osfix ]
		                [-out ]

		          You want a batch file called 'convert.bat' with lines that read:

		          rawTool.exe -png -h C:\temp\image0001.pfm
		          rawTool.exe -png -h C:\temp\image0003.pfm
		          rawTool.exe -png -h C:\temp\image0753.pfm

		          'batchGen -exe rawTool.exe -o "-png -h" -pfix C:\temp\image \
		          -st 0001 -end 0753 -step 2 -sfix .pfm -out convert.bat'

		      Note: multiple options or prefix locations with spaces must be
		            enclosed in double quotes.

* batchGen is a simple but incomplete utility principally for non-programmers! It is included to generate batch files for rawTool, but can be used for other applications with a little imagination.
* The start and end numbers must have the same number of digits. Pad the lower numbers with zeros.
* The -opfix/-osfix options allow you to change the location and filename of the output.

The rawTool utility is built around dcraw , the RAW image converter by Dave Coffin.