Thursday, September 07, 2006

Workflow

This is the bash script I use to convert my photos from RAW. It works most of the time well, only a few pictures need hand-treatment...

#!/bin/bash
set -e
ext=.CRW

for i in *$ext; do
# Get basename of file for easier treatment
bn=`basename $i $ext` ;
#
# Convert from RAW
#

# The following line converts directly to jpg without any treatment
# dcraw -a -c $i | ppmtojpeg > ${bn}.jpg;

# This should do some basic image treatment:
# dcraw -a -4 $i ;
# convert -normalize -gamma 1.8 ${bn}.ppm ${bn}_dcraw4_normalized.jpg ;
# rm $bn.ppm;

# Including an ICC profile, this gives the best results for my screen
dcraw -4 -c -w -m $bn.CRW | pnmnorm -bpercent 0 -wpercent 0.1 -brightmax | pnmtotiff -truecolor >temp.tif;
tifficc -w -i /PATH/TO/eos10d-linear-8apr2004.icc temp.tif ${bn}.tif;
convert $bn.tif ${bn}.jpg ;
rm $bn.tif ;
rm temp.tif;
#
# Copy and set EXIF stuff
#
exiftool -TagsFromFile $i $bn.jpg;
exiftool -Author="My Name" -OwnerName="My Name" -UserComment="(c) My Name" $bn.jpg;
rm $bn.jpg_original;
#
# rotate according to EXIF (only needed if dcraw only is used)
#
# exiftran -i -a ${bn}_dcraw_only.jpg;
done

No comments: