This is a description on how to perform colour calibration of a camera and a specific photo shoot settings under Linux using the UFRaw RAW format handler and the Argyll Color Management System. This probably works under Windows or OsX as well, but it is untested.
After struggling with LPROF and failing to make it work for me (see this how-to), I've reworked my work flow for colour management to incorporate Argyll Color Management System instead. In a related how-to I described how to use the ICC profiles that come with Canon Digital SLR (EOS) together with UFRaw to digitally develop colour calibrated photographs. This how-to describes how you can use the Argyll Color Management System to create your own ICC profile that describes the lighting conditions of a photo session. This profile is then used to develop the RAW photos from your camera with correct colours and brightness.
In figure 1 there is a photograph with the QPCard201 used to calibrate the colours. This is the target, i.e. colour calibration chart, that I've been using and which will be used as an example in this how-to. There is also a set of close-up images showing the results from using the custom profile from this how-to compared to some general profiles that came with the camera. The general profiles required manual white balancing and exposure adjustments to get this close to the custom profile.
In photography, as opposed to when calibrating a scanner, you will need to manually mark the corners of the target in the picture. This is because the Argyll tool for extracting colour information from the image can detect the orientation of the target only if it is facing the camera, like it would in a scanner. For this I use my own GUI which is shown in figure 2. The usage is straightforward — execute the script without any arguments for a list of command line arguments and click on the screendump for usage information of the actual GUI.
In my work flow I use
To put this together I used the following resources
scanin
and colprof
)See also:
ufraw-batch --conf=$HOME/.ufrawrc.make_profile myimage.cr2 \
--out-type=png --output=/tmp/custom_profile.png
convert /tmp/custom_profile.png /tmp/custom_profile.tiff
ChartMarker.py -s 0.5 -a -t <CHT file> \
/tmp/custom_profile.tiff
The parameters are: -s, scale
the image, -a, show sample box areas, and -t, target
template.scanin
to extract the colour values from
the chart in the image. The following line works for me and
gives a nice diagnostics image.
scanin -dioa -F <fiducial coordinates> \
/tmp/custom_profile.tiff <CHT file> <CIE file>
The parameters are: -dioa, create diagnostics image with image
(i), sample box outlines (o) and sample box areas (a), -F,
coordinates for the fiducial square.display diag.tif
This should not be necessary if you used
ChartMarker
with the -a and -t flags. In that case
you can also remove the -dioa flag from
scanin
.colprof
colprof -ag -qu -bn -y /tmp/custom_profile
The parameters are: -ag, gamma+matrix algorithm type, -qu, ultra
high quality, -bn, only A2B table (since it's an input device),
and -y, verify the A2B profile.mv /tmp/custom_profile.icc /tmp/custom.icc
rm /tmp/custom_profile.*
ufraw --conf=$HOME/.ufrawrc.use_profile myimage.cr2