#!/bin/bash
# Converts an Artemis072 image 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.
#
# Syntax:
#	artemis072.sh Infile Outfile [OPTIONS]
# The OPTIONS are options for 'convert', usually contrast adjustments
# or cropping.

NAME=`echo $2 | sed "s/JPG/jpg/"`

if test -f $NAME
then
	echo File $NAME already exists
else
	echo "Processing $1 -> $NAME"
	convert $1 -contrast -contrast -contrast \
		-colorspace Gray -colors 256 $3 $4 $5 $6 $7 $8 $9 \
		-density 150x150 \
		-scale 1400x1000 -quality 70 $NAME
fi

