#!/bin/sh # if [ $# -eq 0 ]; then echo "usage: ilbmtopng file [png_textfile]" >&2 exit 1 fi pngtext=~/graphics/images/pngtext/ilbm.txt if [ $# -gt 1 ]; then pngtext=$2; fi aspect=$(getaspect_ilbm -i "$1") f=$1 case "$1" in *.[Ii][Ff][Ff]) f="${1%.[Ii][Ff][Ff]}";; *.[Ii][Ll][Bb][Mm]) f="${1%.[Ii][Ll][Bb][Mm]}";; *.[Hh][Aa][Mm]) f="${1%.[Hh][Aa][Mm]}";; esac ilbmtoppm -adjustcolors "$1" | \ pnmtopng -gamma 0.4545 -phys $aspect 0 -ztxt $pngtext > "$f.png" .