Introduction / Batch
Scripts
- FarrarFocus-Batch : Creates undeveloped extended dynamic range blended digital negatives and applies adjustment layers of smaller image to full size image.
How to Use It
First convert your raw files to DNG, and make sure your files are named to match up with the Required File Naming section below. Adobe's free DNG conversion tool can be used to batch convert files to DNG format.
If necessary set the Chromatic Aberration and Vignetting in the DNG files (use Adobe Camera Raw for this or any other program which can change DNG settings). White point can also be set in the DNG files, which will override the auto white point computed by the Batch script. When the Batch script loads the DNG files, it will compute and use its own settings for all the other DNG settings.
Make sure no images are open in Photoshop and run the FarrarFocus-Batch script from Photoshop's script menu. This will present a dialog which looks like the following.

*-N.tif : Build blended negatives. This option blends groups bracketed exposures into an undeveloped extended dynamic range blended negative. See section below for description of Control options.
*-D.tif : Build quick development files. This option looks for -N blended digital negative files and builds smaller sized -D files which can be used for quick development. Meaning develop the smaller size file with adjustment layers, and then use the next option to apply those adjustment layers to the full size blended digital negative. The Maximum: options control the maximum size of the smaller -D file.
*-P.tif : Apply quick development to blended negatives. This option looks for -D quick development files and matching -N blended digital negatives, and applies the adjustment layers in the -D file to the corresponding -N file and save as a -P file.
Choose the options to run and then use the Begin button to select a directory of files to process.
Note, this script will automatically go into sub-folders/directories that are inside the directory selected, and processes files in those sub-folders as well.

The script looks at the files in the directory and sub-directories and sees what files need to be processed. So it is safe to run a second time and it will ignore files which have already completed.

Required File Naming
This script requires a specific naming convention so that it knows what to do with the files it sees.
Group-Number.dng
The script looks for the last - (dash) in the file names. Whatever it finds on the left of the last dash it takes as the image group. The right of the last dash should be some kind of exposure number. Note the exposure numbers need NOT be ordered correctly (the script will automatically compute the proper order of exposures based on image histograms).
All images which have the same group are blended together, and the script will output a file Group-N.tif as the result. It also will build the Group-D.tif and Group-P.tif files if those options are selected and it finds the necessary files to do so.
If the following files were in the directory selected.
| filename | notes |
| Group1-0.dng | number order does not matter |
| Group1-2.dng | |
| Group1-32.dng | |
| 20070207-021T-2.dng | only last dash important |
| 20070207-021T-3.dng | |
| 20070207-021T-4.dng | |
| a---3.dng | multiple dashes are ok |
| a---4.dng | |
| a---7.dng | |
| a---N.tif | a previously blended file |
| NoDng-D.tif | will not be able to do anything with this file |
| Neg-N.tif | |
| Neg-D.tif |
The script will output.
| filename | notes |
| Group1-N.tif | blends all files in Group1 |
| Group1-D.tif | built the quick development file |
| 20070207-021T-N.tif | blends all files matching 20070207-021T |
| 20070207-021T-D.tif | quick development file |
| a---D.tif | -N file already done, so only build -D file |
| Neg-P.tif | applies Neg-D adjustment layers to Neg-N |
Required File Naming For Blending Groups for Stitching Later
Similar to the non-stitched case except the Number is prefixed by Position and separated by a _ (underscore).
Group-Position_Number.dng
The Position number marks a group of bracket images taken at the same position in the Group of all images used to build the stitched image. For example here is a group of 3 bracketed series to be stitched later to a full image.
| filename | notes |
| 20071009-011T-01_1.dng | bracket series taken at position 1 |
| 20071009-011T-01_2.dng | |
| 20071009-011T-01_3.dng | |
| 20071009-011T-02_1.dng | bracket series taken at position 2 |
| 20071009-011T-02_2.dng | |
| 20071009-011T-02_3.dng | |
| 20071009-011T-03_1.dng | bracket series taken at position 3 |
| 20071009-011T-03_2.dng | |
| 20071009-011T-03_3.dng |
Control Options

About the only control I personally use here is Keep Layers, and only very rarely. Everything else is already fine tuned to what should be the optimal settings for nearly any bracketed series. However feel free to experiment.
Control 1 - Defaults to 47: Blend in everything below this level (ranges from 0-255). The default is set to 18% gray (or half way between black and white). Lower numbers will cause a smoother blend between exposures at the expense of more noise. Higher numbers will have less noise and a less smooth blend.
Control 2 - Defaults to 189: Blend in nothing above (ranges from 0-255). Used to remove the clipping highlights when blending. Higher numbers will increase quality up to the point where it starts blending in overexposure (ruining the blend). The default is roughly set to the threshold of tonality in the highlights.
Control 3 - Defaults to 4: Controls the blend feather radius (in pixels). Larger radii yield a smoother/softer blend but at the expense of more noise.
Control 4 - Defaults to 8: Controls the allowable highlight clipping. The batch script automatically chops a little off the highlights when the dynamic range becomes extreme (ie shooting the sun without any highlight clipping) in order to make better use of the tonal range. The script will insure that the linear histogram average is above this many (default of 8) levels. Lower values decrease the amount of clipping. Higher values increase the amount of clipping but can yield a higher quality result because usually the clipping is hidden by contrast adjustments.
Keep Layers: In the case where the default blend isn't exactly as desired, use this check box to stop the batch script from flattening the image before saving. It saves an image with one layer per shot in the bracketed series, with the exposures matched and the areas of overexposure removed from the image. You can then go in any adjust the blending manually with Layer Masks.
Gamma - Defaults to Linear: This should always be set to Linear, the only exception is covered in the stitching example.
Improvements Over Previous Bracket Scripts
- The script automatically computes the proper white point and all Adobe Camera Raw settings except Chromatic Aberration and Vignetting. Trying for full automatic settings in FFDD7.
- It automatically adjusts the white level allowing a little clipping. This serves to make the resulting image much lighter and easier to work with.
- It automatically handles exposures that are out of range (to dark to be usable, or too light to be usable [such as an exposure which is 90% white]).
- It has a higher quality blend and automatically merges the output layers into one image.
- It has ability to work with batches of images for stitching. Matching all the exposures to a common level for all the sub groups of images.
- It gives feedback on the blending process.
- New feature for generating a quick development file. Basically a low resolution copy of the digital negative, which can be developed with adjustment layers, then using the Apply quick development to blended negatives option, these adjustment layers will be applied to the full size image.
- All of the functionality runs as a fully batch process. Ideal for running overnight on thousands of files at one time.
- It will skip files with problems and continue with other files. Skipped files are noted in log.
FAQ
What do the numbers between the parentheses mean in the batch script log window?
For example, image-N.tif ... (1.014,0.662, 0.393, 0.214). Starting from the (darkest to lightest) negative, the numbers inside the parentheses represent the exposure setting that was used to blend that negative into the final blended negative. A setting of 2.000 means exposure was increased by one stop, 1.000 means no adjustment, 0.500 means exposure decreased by 1 stop, 0.250 means exposure decreased by 2 stops, and so on.
The final exposure number in the parentheses can be used to gage both noise and dynamic range using the following table. The practical limit of dynamic range is probably somewhere around 12-14 stops, at which point including more overexposed shots will not make any quality difference.
| number | rough meaning |
| (... 2.000) | 4 stops of dynamic range, 2x the noise |
| (... 1.000) | 5 stops of dynamic range, same noise as single exposure |
| (... 0.500) | 6 stops of dynamic range, 1/2 the noise |
| (... 0.250) | 7 stops of dynamic range, 1/4 the noise |
| (... 0.125) | 8 stops of dynamic range, 1/8 the noise |
| (... 0.063) | 9 stops of dynamic range, 1/16 the noise |
| (... 0.031) | 10 stops of dynamic range, 1/32 the noise |
| (... 0.016) | 11 stops of dynamic range, 1/64 the noise |
| (... 0.008) | 12 stops of dynamic range, 1/128 the noise |
| (... 0.004) | 13 stops of dynamic range, 1/256 the noise |
| (... 0.002) | 14 stops of dynamic range, 1/512 the noise |
| (... 0.001) | 15 stops of dynamic range, 1/1024 the noise |
What does "Base exposure is clipping in highlights" mean?
This means that the darkest exposure in the bracketed series has data in the brightest level (level 255) of the histogram. So the batch script writes out this warning. Ideally you want to have the darkest exposure in a bracketed series without any highlight clipping. However in some cases, such as shooting at the sun or a very bright point light, there is always going to be some highlight clipping.
What does "Using level N as white" mean?
The batch script automatically expands the darkest negative to use all 256 levels. This message is simply noting what the previous highest level was.