Fun things to do with computers and photographs
Random header image... Refresh for more!

RAW conversion

One of the main reasons for writing photohack was to batch process RAW files. This set of options consist of those that I felt most appropriate to be done during “RAW” processing, in which photohack takes the RAW file and generates a cached, processed TIFF image, which it then uses for further processing.

While most of the work is done by dcraw, some of them are done by ImageMagick and can therefore be used with JPEG files as well as RAW files.

Options that work only on RAW files

For additional information on these options, see also theĀ dcraw man page. This should be referred to whenever the “-X dcraw option” is mentioned.

Correct chromatic aberration. First number adjusts magnification of the red channel, second of the blue channel. Values should generally be between -50and +50.
exposure =-0.3
Adjust exposure, specified in stops.
Set the highlight recovery algorithm. If the highlights clip, try blend. A higher gamma value will be needed in this case, typically. Values between 3 and 9: “Reconstruct highlights. Low numbers favor whites; high numbers favor colors.” (See the dcraw -H option.)
Use dcraw’s noise reduction. The value should be between 100 and 1000.
profile=profile.icc [untested]
profile=profile.icc,profile.icc [untested]
Specify the color profile. The default is srgb. The last two options specify an input profile as a filename, and an input and output profile as filenames. These profile files must be in the photohack_files directory.
Specify how white balance conversion is done. By default, photohack (dcraw) uses the camera’s white balance setting. You can also choose auto white balance based on the image, or specify a color temperature (this works only if your camera has been used to generate a set of white balance coefficients – see config wb).

Options that work on RAW files and JPEG files

Rotate the image by a multiple of 90 degrees: the given values correspond to 90, 180, and 270 degrees. By default, the RAW conversion will rotate the image according to the orientation flag in the image (as set by the camera). If it’s not correct for some reason, then use this option.
Implement barrel distortion correction. The first form of this command is adequate for most common uses. It takes a single integer which specifies the amount of correction. Try 12 to start with and increase or decrease it as needed. To correct pin-cushion distortion, use a negative value. The second form of the command is more elaborate but can be used to correct more complex forms of distortion. It requires that you provide the four coefficients for the distortion correction operation, as described in the ImageMagick usage guide.
Set the gamma conversion used to convert the linear (gamma=1) RAW output into the more useful non-linear output. The first value is the gamma, the second is the “toe slope.” In the case of a JPEG file, the second value is ignored.
Rotate the image by some small amount. The image will be rotated by the specified amount, but corners will have a grey triangle in them, so the image will need to be cropped.

Where these options can be provided

The RAW processing parameters can be provided in the following configuration files: camera.txt. They can be provided as arguments to the following commands: options and variant.