#!/bin/bash -noprofile
#
# Converts all pictures in current directory to rgb format --
# using the `convert' utility from the `ImageMagick' package
#

suffix=".bmp"

for filename in pattern*$suffix
do
	echo -n "converting ${filename}... "
	base_filename=`basename $filename $suffix`
	if [ -e ${base_filename}.rgb ]
	then
		echo "skipped."
	else
		convert $filename gray:${base_filename}.gray
		echo "done."
	fi
done
