#!/bin/bash if [ -z "$1" ]; then args=test; else args="$*"; fi outfile=mandelgen_$(echo $args | tr ' ' '_') echo creating $outfile.jpg # use ImageMagick where available, else graphicsmagick if mandelgen.py $* > ~/pics/$outfile.ppm; then if convert -quality 100 ~/pics/$outfile.ppm ~/pics/$outfile.jpg; then rm -f ~/pics/$outfile.ppm elif gm convert -quality 100 ~/pics/$outfile.ppm ~/pics/$outfile.jpg; then rm -f ~/pics/$outfile.ppm fi fi