After some more experimentation using dcraw.c becomes too laborious, I may use it for special cases, but mostly going to create the 16-bit TIFFs with Apple Aperture (similar to . So I focused on finetuning and automating the ImageMagick part. In order to preserve the EXIF-data, I added exiftools to the script (installation to Linux via command sudo apt-get install libimage-exiftool-perl. Script is also tested to work well with gamma 1.0 color space (CIE 1932 D65).
Script automatically processes all TIFF-images in the directory, and makes 975px wide and tall version of each one. Finally it removes the TIFF-images (you may comment this part if you prefer to keep them.
The ICC-profile script is using (sRGB.icc) can be found from ImageMagick directories.
#!/bin/bash
# First defining which files to process
FILES=/mnt/hgfs/RAWtest/*.tiff
# Then looping through TIFF files
for f in $FILES
do
# Finding base of the name (without the .tiff)
SAMULIBASENAME=`basename $f ".tiff"`
# Resizing and sharpening - 975px height
convert $SAMULIBASENAME.tiff -sharpen 1x50+0 tif:- | convert tif:- -interpolate bicubic -resize 'x3200' tif:- | convert tif:- -sharpen 0.6x25+0 tif:- | con
vert tif:- -interpolate bicubic -resize 'x1800' tif:- | convert tif:- -sharpen 0.2x5+0 tif:- | convert tif:- -interpolate bicubic -resize 'x975' tif:- | conv
ert tif:- -profile sRGB.icc tif:- | convert tif:- -quality 87 $SAMULIBASENAME'_x975px.jpg'
# Transferring EXIF from TIFF-file to created JPG-file
exiftool -tagsFromFile $SAMULIBASENAME.tiff $SAMULIBASENAME'_x975px.jpg'
# Removing the file exiftools adds
rm $SAMULIBASENAME'_x975px.jpg_original'
# Resizing and sharpening - 975px width
convert $SAMULIBASENAME.tiff -sharpen 1x50+0 tif:- | convert tif:- -interpolate bicubic -resize '4500' tif:- | convert tif:- -sharpen 0.6x25+0 tif:- | conv
ert tif:- -interpolate bicubic -resize '2150' tif:- | convert tif:- -sharpen 0.2x5+0 tif:- | convert tif:- -interpolate bicubic -resize '975' tif:- | convert
tif:- -profile sRGB.icc tif:- | convert tif:- -quality 87 $SAMULIBASENAME'_975px.jpg'
# Transferring EXIF from TIFF-file to created JPG-file
exiftool -tagsFromFile $SAMULIBASENAME.tiff $SAMULIBASENAME'_975px.jpg'
# Removing the file exiftools adds
rm $SAMULIBASENAME'_975px.jpg_original'
#removing the TIFF - if you don't want this then comment this
rm $SAMULIBASENAME.tiff
done