#!/bin/sh bmptopnm "$1" 2>/dev/null | ppmtopgm | pgmtopbm | \ pbmtojbg -q >"${1%.[Bb][Mm][Pp]}.jbg" .