#!/bin/bash # Script for converting an png image to 8bit semitransparent files base-* and focus-* for using as menu items if [ ! command -v convert >/dev/null 2>&1 ]; then >&2 echo "convert executable could not be found" exit 128 fi if [ ! command -v pngquant >/dev/null 2>&1 ]; then >&2 echo "pngquant executable could not be found" exit 128 fi if [ "$1" = "" ]; then >&2 echo "zadej filename" exit 1 fi filename="$1" convert "$filename" -channel A -evaluate Multiply 0.5 +channel -resize 64x64 "prefocus-$filename" pngquant 256 < "prefocus-$filename" > "focus-$filename" rm "prefocus-$filename" convert "$filename" -channel A -evaluate Multiply 0.9 +channel -resize 48x48 "prebody-$filename" pngquant 256 < "prebody-$filename" > "body-$filename" rm "prebody-$filename"