#!/bin/bash
# Converts one of Paul's images to a better format for online viewing.
# The principal parameter that I think is adjustable here as far as image 
# quality is concerned is "-quality".  At 50, the visible artifacts are
# still there, but I think they're very acceptable, and the image is
# ~150K.  At 25 (~100K), they start to be objectionable in my eyes, and
# at 10 (~50K) they are very obvious to anyone, but the text can still be
# read.  The other things that might be adjustable are the crop offsets
# (+X+Y).
#
# Syntax:
#	paul.sh Infile Outfile [OPTIONS]
# The OPTIONS are options for 'convert', usually contrast adjustments.

if test -f $2
then
	echo File $2 already exists
else
	echo "Processing $1 -> $2"
	convert $1 -colorspace Gray -colors 256 $3 $4 $5 $6 $7 $8 $9 \
		-density 150x150 -crop 2760x2100+150+160 \
		-scale 1314x1000 -quality 50 $2
fi

