Digital Photography Workflow

"The illiterate of the future will be the person ignorant of the use of the camera as well as the pen."    — Anonymous.
On this page:

Sorting things up

Images are taken by pressing a trigger on a camera and then we tend to think it's done. But it's actually where the main work starts. It used to be simple: take a first look at the slides and make 3 piles: the straight to garbage pile, the archive (back in the box, never to be seen again), and those to put in trays for display. Digital photography changed all that.

In the way I want to work with digital images, I've decided on one basic absolute rule: "information pertaining to the images are saved in the images", meaning the 'what, who, where' must be in some extra field of the file and not in the filesystem or in some obscure database program. The idea being that if you move or rename the files or change management system, the information stays with the corresponding image. The problem is to ensure that this information is readily accessible to the user and maintained by programs transforming, using or displaying the images.

To further complicate things, I have images from several main sources, what I will call here the 'source image', which gets corrected for defects and saved into an 'archive image' and then often deleted. This archive image gets transformed into a half resolution jpeg version for quick distribution, a medium jpeg for web viewing and a tiny thumbnail version for web catalogs. Some of those transformations are made by myself and a graphic program (such as Buy at Amazon.comPhotoshop, Buy at Amazon.comPaint Shop Pro, Gimp), while others are made by automated scripts (IrfanView, ImageMagick, jhead...). Most of the command line scripts I describe below are for Linux but also for Windows with the appropriate tools (Cygwin).



Image formats

Let's start with understanding the basic file formats used in the archival and distribution of digital images. Only about 4 are useful for the average photographer out of the hundreds that exist.

File type PS, PSP TIF PNG RAW, DNG, RAF JPEG
Origin Graphic programs Scanners Graphic programs Digital cameras Digital cameras
Main use Archival, intermediate work copy Archival, professional printing, intermediate Archival Digital negative, archival Web display, distribution
16 bit support Yes Yes Yes, but unsupported by most programs Yes No
Compression Lossless [*] Lossy (much smaller size), some programs allow for lossless operations
EXIF [*] Yes, but only from the creating program Yes, but support is lacking in most program Yes, but only from the creating program Yes
Typical image manipulation programs Photoshop, Paint Shop Pro, Gimp... Camera specific program, Adobe Lightroom IrfanView, Web browser
Embedded ICC profiles Yes Yes, but unsupported by most programs Yes Yes, but unsupported by most browsers.
Overall compatibility Poor Good, but some progs accept only limited compression methods out of the optional LZW/Huffman/Packbits/Fax/Uncompressed. Good, but frequent lack of support for some options (16 bits, ICC profiles, EXIF, Comments...) Poor (those are new formats, still in progress and heavily dependent on hardware) Good, but frequent lack of support for some options (EXIF, ICC profiles)
Archival Use Yes, but produces very large files and only the same prog can open it Yes Somewhat (lack of support for ICC and EXIF inhibits this) Yes, but needs the exact same program to extract a consistent image Not advised
Web Use No Possible, but overkill No Yes

So, seen from the files themselves, a simplified workflow can be: Scanner —> 16-bit TIF temporary file —> Photoshop —> 8-bit TIF archive —> Conversion script —> Large, medium and thumbnail JPEG files.

Another solution is: Digital camera —> source DNG file —> Adobe Lightroom —> 8-bit TIF archive —> Conversion script —> Large, medium and thumbnail JPEG files.

See below for three detailed workflow examples.


Glossary and Notes

EXIF field
Exchangeable Image File Format. A metadata standard that supports the storage of extended camera or image information within the header of an image file. Most digital cameras save this information and users can modify or add some of it. EXIF information is displayed with the command lines jhead or EXIF as well as most graphic programs.
Comment field
For TIF and PNG files, before the standardization of EXIF, this was a special field where extra information such as Author, Copyright, Comment, Keywords, etc were saved. Note that both Comment field and EXIF field serve the same purpose and can coexist, which doesn't keep things simple. It is now desirable but not always easy to unify this information inside EXIF fields: some programs will support the EXIF field of some file formats in EXIF but not the comment field, while the opposite is true of other programs. And transferring the information back and forth between Comment fields and EXIF fields is not easy either.
HDR
High density range images. This is a rapidly changing field where images details are defined in term of their real world light intensity. So for instance one pixel is marked twice as bright as the previous one, and the next one 1.4 times as bright, etc, without arbitrary limits. Such images are more convenient for some kinds of digital processing but they cannot be taken directly from a camera (they must be assembled from separate shots) and they cannot be displayed or printed directly without a process known as tone mapping. Some examples here.
IPTC field
This is yet another reserved information field for image files defined by news agencies for the purpose of identifying transmitted images.
Lossless
Refers to an image format where all the color data is retained, even if some form of compression is performed. This applies to TIF (optional compression), PNG and RAW/DNG formats.
Lossy
Refers to a way to encode the image that removes some information theoretically invisible to the eye, but often resulting in what is known as 'jpeg artifacts'. JPEG and JP2 are prime examples. In a perfect world, one should never change a jpeg image as the compression defects accumulate each time; you should produce jpeg images only starting from one of your reference archival files. For instance if you want to rotate an image or just change a word in the exif comments, you shouldn't have to loose image quality, right ? Well, most programs get that wrong and loose bits and pieces in the process. Image rotation done in Windows Explorer will recompress the image, worsening the jpeg artifacts and also forgetting the ICC profiles. Paint Shop Pro browser performs a lossless rotation, but EXIF information disappear. Only IrfanView browser (press [T]) well hidden [Jpeg lossless Operations] will maintain ICC profiles, EXIF information and pixel data. That's what I use to rotate jpeg files. In other words test your image rotation/exif writer tools by doing a double modification: the result should be identical, bit for bit to the original (use WinDiff to check for differences).
16-bit support
Produces images with 281474 billion colors (65536 colors for each of the Red, Green and Blue channels) instead of 'just' 16 million (256 colors for each channel) for standard color images. The difference is invisible to the eye (you'd need a 16-bit monitor or printer in the first place), but can change greatly the result when passing the image through various filters such as histogram or contrast enhancements. After transformation to a satisfactory result, it is often overkill to keep the original 16 bit image. Note that this is also called 48-bit images (sum of the three 16-bit channels). On the other hand, note that greyscale images are better kept as 16-bits for archival as 256 tones of grey is decidedly not much.
ICC profiles
An optional extra data field within an image file containing advanced color information. The default profile is 'sRGB' but several others can be used such as 'Adobe RGB' which can represent more saturated colors (wider gamut). Care should be taken when using a profile different than sRGB. Can your imaging program display it properly ? (In Paint Shop Pro the option is hidden in [File][Color Management][Color Working Space][Use Embedded Profiles] and can be changed only if no image is loaded). Will a conversion script maintain the profiles inside the newly created images ? (only if you are very careful). Can your printer print it properly ? (Only if you use advanced options in Photoshop or if you load the correct profile in the [Color Management] option of your printer driver). Note that a lack of embedded profile within an image does not necessarily imply that sRGB is used...


Very quick review of imaging programs

There are many other similar programs. This is only a list of things I use daily or that I've used in the past.

VueScan
A good technical scanning program. Its main advantage is that it works with almost all hardware as well as under Windows, Linux and Mac. So adaptation time to a new setup is nil once you have taken the time to master it. It can also reprocess TIF files. Other scanning programs include Kooka, Sane, NikonScan, SilverFast...
Photoshop
The reference in image manipulation. Expensive and old fashioned interface. Buy at Amazon.comPurchase Photoshop here.
Paint Shop Pro
Very similar to Photoshop and much cheaper as well. Windows only. Only partial 16 bit support as of 2006. Buy at Amazon.comPurchase Paint Shop Pro here.
Picture Window Pro
Simpler than PS, but still has 16 bit support, raw support, batch... Windows only. I've never tried it. Site here.
Gimp
Similar to the above three programs, free, and works on Mac and Linux as well. No 16-bit support. Buy at Amazon.comManual here.
Adobe Lightroom
Currently free beta version of a new breed of image manipulation programs, meant to be used to reveal 'digital negatives'. Its use is rather visual, the whole methodology is centered around processing of a batches of images while still maintain user control.
IrfanView
Great fast image display program for Windows only (unfortunately). Free download. Can perform basic manipulations as well as basic script transformation (resize of a set of images for instance). Only program I could find with correct lossless rotation of JPEG images. I set it up to display every image format by default, using full screen instead of the poor Preview program of Explorer. Here's the ini configuration file I use (save it in C:\Program Files\IrfanView or wherever you keep IrfanView). Press [Esc] to exit IrfanView and [Enter] to access the menu when in full screen mode. Also this prog doesn't require installation, you can just put its directory on a USB key. Did I say that this program is great ?
Filesystem viewers
Most modern filesystem access programs (Windows Explorer, Konqueror, Apple Finder...) can display the files in the form of thumbnails, previews and also allow for a few basic transformations. For instance in WinXP Windows Explorer, you can righ-click on an image file and choose [Rotate Left] if the orientation is wrong. But don't do it (see above about lossy compression) ! Also when looking for an image management program, remember that the filesystem itself is always the best way to manipulate files. D'OH! It's their purpose. The problem is that when you consider images, they don't necessarily get manipulated with the same convenience as files.
Image management programs
Such as Picasa. I've tried several of them and personally I find image management software overly complicated, lacking and buggy. Things to test: do they incorporate EXIF fields in their data base when reading the images ? Can they do the opposite, that is, add keywords to the Exif field ? Can their keywords and comments be easily exported, for instance to a web page, csv file, SQL database, etc... Do they maintain and can they perform color profile changes ? Can they even figure it out if you've moved the files manually ?!? My main gripe about Picasa is that I can't even tell it where my images are. Hint: not in the My pictures folder.
Jhead.exe
Command line program for manipulating settings and thumbnails in EXIF jpeg headers. Particularly useful to rename files according to their EXIF information). Free download. For windows you only need to save it in your C:\Windows\System32 directory, but if you have cygwin installed, you can also issue the following command in a bash window: wget http://www.sentex.net/~mwandel/jhead/jhead-latest.tar.gz && tar zxvf jhead-latest.tar.gz && cd jhead-2.6 && make && cp jhead /bin (note: version number may vary)
Exif.exe
Command line to shows EXIF information in JPEG files. Originally a Linux program. For Windows, download as part of Cygwin.
Exif Farm
There are many EXIF manipulation programs on the market, both freeware and payware. I long searched for one with the following characteristics: integration with Windows Explorer (Right-click to access the EXIF data), batch change (can set specific fields on several images), recall of past set fields, transfer from on image to others, no change to the data bits (meaning no recompression of the jpeg data, doh), maintain all other fields (such as ICC profiles), support for TIF, PNG and JPEG. ExifFarm if the closest to this, only lacking PNG support, field recall or transfer, and being somewhat unreliable.
ImageMagick, GD, LCMS...
Various similar sets of command line manipulation programs (particularly useful to batch process large amount of images or process them on request, for instance from a server). Originally Linux programs, they can either be installed as part of cygwin or as Windows executable.
PTgui
Advanced program to stitch images into a panorama. It can also be used to precisely align images taken with various exposures before feeding them to Photomatix. Here.
Photomatix
Advanced program to merge images of various exposures, thus extending the dynamic range of an image. This is necessary if the contrast of a scene exceeds what your camera or scanner can represent (burned or black areas). Here.
Browsers
Internet Explorer, Mozilla, Opera... Used to display images on the web, most of them ignore ICC profiles, so images are better converted to a standard sRGB profile beforehand, although the visual difference is not huge.
Servers
Complex web server combinations such as Apache+Php+SQL+Gallery2+GD can automatically perform image manipulations. For instance you dump large images in a directory structure and the server performs on-the-fly creation of thumbnail images and web pages with comments extracted from the EXIF fields. This is fairly complicated to setup but allows full control depending on your needs (for instance free medium format images and micro payment for large downloads). Once properly configured, it can be very efficient. I'll give a simplified script below.

Workflows

From scanner From digital negative (DNG) From digital camera (JPEG)
Preliminary stage Scan the film after careful dust-off, saving as 16-bit TIF files. During the scan pay special attention to white and black point as well as color density and contrast. Perform batch scans only if all images are very similar. Copy images from camera.
Run them through LightRoom (orientation, color correction, histogram...) and save the results as TIF files.
Copy images from camera.
Rotate images losslessly using IrfanView in Thumbnail view.
Delete everything that sucks (using the basic thumbnail view from your file manager or running quickly through the heap with IrfanView and the [Delete] key)
Advanced high density step (optional) If the film shows very high contrast, perform several scans with pushed [Input][Lock Exposure][RGB Exposure] in ViewScan. Merge them using Photomatix, save as 16-bit TIF. If the scene shows very high contrast, you can take several shots changing the exposure settings. Make sure the camera is well fixed on a tripod or you'll need to align the images with PTgui first, using the [Create Panorama][Layers][Individual Layers Only] final file creation option.
Retouch Open image in your graphic program (PS, PSP, Gimp...), check histogram, apply filters on copied layers such as [Clarify] or [One Step Photo Fix]. Mix the layers according to taste (30% transparency, overlay, possibly delete some parts of some layers...). Merge all. Straighten image. Crop image. Convert to 8 bit per channel. Clean specks or scrapes with clone brush, makeover tool or scratch remover. Save as TIF. None necessary if you have been careful in Lightroom. Try to not perform anything that can affect the data bits of the image as it'll drop the quality by increasing the compression artifacts (very visible on the side of smooth areas). But sometimes straightening, crop or defect repair are necessary. In that case save under a slightly different name and keep the original.
Organization Rename files manually using appropriate date and keywords (YYYY-Subject-Keywords) Rename the TIF files automatically according to EXIF date, if it's still available in the file, otherwise manually. Rename them automatically according to EXIF date. Add appropriate keywords to image name.
Information fields Open images individually or in batches using an EXIF editor such as ExifFarm. Set appropriate information: Author, Copyright, Comment, Keywords, Location...
Archival Move images files to appropriate folders (for instance named according to date YYYYMMDD-Theme-Keywords). Try to avoid spaces in both directory names and file names, as it complicates the writing of scripts. This is your archive copy. Back it up. In most cases you'll want to delete the preliminary files or move them away so as not to confuse the various versions.
Everyday copy Run a script to convert from TIF to JPEG, if possible converting the color profile to sRGB, and maybe resampling the resolution if the number of pixels if above 10 million.Just copy the files, possibly halving the resolution if the number of pixels is above 10 million.
Thumbnail generation Run a script to resample the images to a fixed size, keeping the aspect ratio, discarding ICC info. Keep EXIF info only if it is used by your server (for instance a PHP application able to add web comments from the EXIF content).
Web page generation Either rely on the server to do all the work: Apache can generate pages with links to files, php can generate pages of thumbnails with links to the original files, Gallery2 can do much more. Or run a script to generate static pages from the available images. See script below.


Shell scripts and one-liners

You will find here several scripts I use for everyday image transformation. They all run in shell scripts, meaning they will run in Linux, OSX and a Cygwin bash window under Windows. In windows you can save them in a .sh file but you cannot run them directly with a double click on the file icon. You need to open a bash window in the appropriate directory and invoke ./scriptname.sh

If you really want to run them directly with a double click from Windows Explorer, create each Script.sh and create a twin file called Script.bat containing the following three lines:

SET PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin"
c:\cygwin\bin\bash Script.sh
PAUSE
Then double click on the .bat file instead of the .sh file.

Those scripts are highly customized for my needs, so you'll probably need to modify them for your own use, but they provide a start.

Digital file handling

After you transfer files from your digital camera to your PC, run this script from the directory where you saved the files. Read through the comments to see what it does.

#! /bin/sh
# Transfer files from camera and rename them according to the date taken.
# This scripts operates only on the files found in the current directory, 
# so files moved under subdirectories are not touched.

###############################################################################
# Optional: Find files without added keywords in their names, left from previous runs
echo "Nameless files:"
find -iregex ".*/[0-9]*[-_][0-9]*.jpg"


###############################################################################
# Copy files from digital camera (remember to reformat the card afterwards)
# Note: camera should be in 'Mass Storage' USB mode and connected
# Path is different on each model of camera
cp /cygdrive/d/camera/DCOM/* .


###############################################################################
# Rename according to exif date/time (requires jhead.exe)
# Original names are lost (but who cares)
# Note that this ignores DNG/AVI/HTM files which your camera may produce as well.
jhead -nf"%Y%m%d-%H%M%S" *.jpg *.JPG


###############################################################################
# Create dated directories and move corresponding files to them
# Ignores DNG/AVI/HTM files
ls -1 *.jpg | 
	sed -e "s%\(.*\)-.*%mkdir -pv \1; mv -uv \0 \1/\0%" >/tmp/$$
. /tmp/$$


###############################################################################
# Optional: Convert file extensions to lowercase
#find . -name \*.AVI -o -name \*.DNG -o -name \*.JPG | sed -e "s/\(.*\)\.AVI/mv -i \"\0\" \"\1.avi_\"/" -e "s/\(.*\)\.DNG/mv -i \"\0\" \"\1.dng_\"/" -e "s/\(.*\)\.JPG/mv -i \"\0\" \"\1.jpg_\"/" >/tmp/$$.sh
#. /tmp/$$.sh
#find . -name \*.avi_ -o -name \*.dng_ -o -name \*.jpg_ | sed -e "s/\(.*\)\.avi_/mv -i \"\0\" \"\1.avi\"/" -e "s/\(.*\)\.dng_/mv -i \"\0\" \"\1.dng\"/" -e "s/\(.*\)\.jpg_/mv -i \"\0\" \"\1.jpg\"/" >/tmp/$$.sh
#. /tmp/$$.sh

Generate a static but easily extendable image gallery from Archive files

#! /bin/sh
# PrepareImages.sh
# This script needs GenerateHtml.sh in the same directory and ImageMagick on the system.
#
# Purpose: It takes large TIF/PNG images found in ./Large/ and converts them to jpg inplace
# Then it creates half resolution versions in ./Medium/ and thumbnails in ./Small/
# Then it creates simple web pages with the thumbnails and links to the medium images.
# The idea is that the current directory is served on the web.
#
# Use: under the directory where those two scripts are located, create a directory ./Large
# Copy (not move) inside all the images you want to publish (TIF, PNG, JPG...), possibly inside subdirectories.
# Run the script without parameter. You can then delete images left in ./Large/ (optional)
# Next time, you just add other images and run the script again.
# Images are never removed from ./Medium/ and ./Small/

###############################################################################
# Removes spaces found in file or directory names.
# Note: possible name collision here.
# Note: you might want to run those two lines more than once (I usually have no more than one space per filename)
echo
echo "### No spaces in file names"
find Large -name "* *" | 
sed -e "s/\(.*\) \(.*\)/mv -iv \"\0\" \"\1_\2\"/"  >/tmp/$$.sh
. /tmp/$$.sh


###############################################################################
# Optional: Delete intermediate pano files and other unwanted files
# You might want to customize this to your usual temp files
echo
echo "### Deleting intermediate pano files and non-graphic files"
find Large \( -regex ".*P[0-9]*_*.[jJ][pP][gG]" -o -regex ".*P[0-9]*_*.[tT][iI][fF]" -o -regex ".*[0-9][0-9][0-9][0-9].[jJ][pP][gG]" -o -regex ".*[0-9][0-9][0-9][0-9].[tT][iI][fF]" -o -iname \*.pts \) -exec rm -v {} \;


###############################################################################
# Convert tif to jpg, keeping same resolution.
# Note: possible name collision here. No overwrite if this is the case.
find Large \( -iname \*.tif -o -iname \*.png \) -exec echo echo {} \; -exec echo convert {} jpg:{}.jpg \; | 
sed -e "s/\.tif\.jpg/.jpg/" -e "s/\.png\.jpg/.jpg/" > /tmp/$$

echo
echo "### Converting tif & png to jpg"
chmod -R -w Large	# Avoids overwrite of already existing jpg files
. /tmp/$$		# Execute tif to jpg conversion
chmod -R u+w Large	# Reinstates write permission


###############################################################################
# Delete the now transformed tif and png files
echo
echo "### Deleting tif and png files"
find Large \( -iname \*.tif -o -iname \*.png \) -exec rm -v {} \;



###############################################################################
# Copy files before conversion - Do not overwrite already existing files
# This may take a while if there are many new files
echo
echo "### Creating Medium files (reduce by 50%)"
find Medium -iname \*.jpg >/tmp/Exclude
find Large -iname \*.jpg -exec echo mkdir {} \; -exec echo echo {} \; -exec echo convert -resize 50x50% -sharpen 1 {} jpg:{} \; | 
sed -e "s%echo Large%echo Medium%" -e "s%jpg:Large%jpg:Medium%" -e "s%mkdir Large/\(.*\)/.*%mkdir -p Medium/\1%" | 
grep -vf /tmp/Exclude >/tmp/$$
. /tmp/$$

echo
echo "### Creating Thumbnail files (reduce to fit within 300x300 pixels)"
find Small -iname \*.jpg >/tmp/Exclude
find Large -iname \*.jpg -exec echo mkdir {} \; -exec echo echo {} \; -exec echo convert -thumbnail 300x300 -sharpen 1 {} jpg:{} \; | 
sed -e "s%echo Large%echo Small%" -e "s%jpg:Large%jpg:Small%" -e "s%mkdir Large/\(.*\)/.*%mkdir -p Small/\1%" | 
grep -vf /tmp/Exclude >/tmp/$$
. /tmp/$$


###############################################################################
# Convert AdobeRGB profiles to sRGB, if found
# We leave the Large images 'as is', we ignore the thumbnails (the profiles have been striped) and convert only the medium images
echo
echo "### Color profile conversion"
find ./Medium -iname \*.jpg -print -exec exif -m {} \; | 
egrep -i "\.jpg|Color" | 
tr "\n" "#" | 
sed -e 's%#./%\n%g' | 
grep "#Color Space" | 
grep -v sRGB | 
# This line uses ImageMagick
# sed -e "s/#Color Space.*//" -e "s%.*%convert -verbose -profile /cygdrive/c/WINDOWS/system32/spool/drivers/color/AdobeRGB1998.icc \0 -profile /cygdrive/c/WINDOWS/system32/spool/drivers/color/sRGB.icm /tmp/$$.jpg \&\& mv -f /tmp/$$.jpg \0%" > /tmp/$$
# This line uses LCMS. Both work, so use either one
sed -e "s/#Color Space.*//" -e "s%.*%jpegicc -n -q90 -i/cygdrive/c/WINDOWS/system32/spool/drivers/color/AdobeRGB1998.icc \0 /tmp/$$.jpg \&\& mv -f /tmp/$$.jpg \0%" > /tmp/$$
. /tmp/$$


###############################################################################
# Set file date to Exif date, if present
echo
echo "### Setting exif date if available"
jhead -ft **/*.jpg

###############################################################################
# Create basic html pages - Needs the GenerateHtml.sh file in the same directory
echo
echo "### Creating html files"
find Small -mindepth 2 -type d -exec GenerateHtml.sh {} \;
# You should add a basic redirect from here to ./Small/index.html

###############################################################################
# Set proper permissions
echo
echo "### Setting permissions"
chmod -R 755 Large	# Needs access to avi files
chmod -R 755 Medium
chmod -R 755 Small

###############################################################################
# Look for remaining useless files
echo
echo "### Files that are not delt with:"
find Large -iname "*.psp*"
echo
echo "### Now go back to ./Large/, delete the remaining unwanted files and run this script again (it'll be much quicker the 2nd time)."
#! /bin/sh
# GenerateHtml.sh
# Purpose: this script is called by PrepareImage.sh to generate index.html files in every directory containing thumbnails.
# The generated page is very basic and contains: 
# - links to possible avi files located in ./Large
# - IMG thumbnails, with links pointing to the ./Medium/ version of the same image
# It assumes the server is Apache and it uses some of the icons provided by a default install of Apache.

cd $1
Dest=$(echo $1 | sed -e "s%Small/%../../../Medium/%")
DestL=$(echo $1 | sed -e "s%Small/%../../../Large/%")

echo "<HTML><HEAD><TITLE>Photos $1</TITLE><LINK REL=stylesheet HREF="http://www.gdargaud.net/StyleGD.css" TYPE="text/css"></HEAD>" >index.html
echo "<BODY><H1>Photos $1</H1>" >>index.html

echo "<P><A HREF='..'><IMG SRC='/icons/back.gif'> [ Up one directory... ]</A></P>" >>index.html

ls -1 $DestL/*.avi | 
sed -e "s%.*/%%" -e "s%.*%<P><A HREF='$DestL/\0'><IMG SRC='/icons/movie.gif'> [ Video ]</A></P>%" >>index.html

ls -1 *.jpg | 
sed -e "s%.*%<A HREF='$Dest/\0'><IMG SRC='\0' ALT='\0'></A>%" >>index.html

echo "<P><A HREF="$Dest"><IMG SRC='/icons/folder.gif'> [ $Dest ]</A> just for the list of larger images.</P>" >>index.html

echo "</BODY></HTML>" >>index.html

Verification of profiles before web publication

#! /bin/sh
# FindWrongProfile.sh
# Find jpg files with a color profile explicitly set to something different than sRGB
# Jpeg files on a website should be in default sRGB format. This is not crucial.
# Note that 'tr' is an optional install in cygwin
find -iname \*.jpg -print -exec exif -m {} \; | 
egrep -i "\.jpg|Color" | 
tr "\n" "#" | 
sed -e 's%#./%\n%g' | 
grep "#Color Space" | 
grep -v sRGB | 
sed -e "s/#Color Space//"
#! /bin/sh
# ConvertProfiles.sh
# Find all jpg files with a color profile explicitly set to something different than sRGB and converts it to sRGB, assuming the initial profile is AdobeRGB
# Uses jpegicc which is part of LCMS
# Make sure you have a backup before running this !!!
find -iname \*.jpg -print -exec exif -m {} \; | 
egrep -i "\.jpg|Color" | 
tr "\n" "#" | 
sed -e 's%#./%\n%g' | 
grep "#Color Space" | 
grep -v sRGB | 
# This line uses ImageMagick
# sed -e "s/#Color Space.*//" -e "s%.*%convert -verbose -profile /cygdrive/c/WINDOWS/system32/spool/drivers/color/AdobeRGB1998.icc \0 -profile /cygdrive/c/WINDOWS/system32/spool/drivers/color/sRGB.icm /tmp/$$.jpg \&\& mv -f /tmp/$$.jpg \0%" > /tmp/$$
# This line uses LCMS. Both work, so use either one
sed -e "s/#Color Space.*//" -e "s%.*%jpegicc -v -n -q90 -i/cygdrive/c/WINDOWS/system32/spool/drivers/color/AdobeRGB1998.icc \0 /tmp/$$.jpg \&\& mv -f /tmp/$$.jpg \0%" > /tmp/$$
. /tmp/$$	# executes the generated code

Let me say that again: those scripts rename, move and transform image files, so make sure you test or use them only on backup copies of your files.