You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
730 B
23 lines
730 B
#!/bin/bash
|
|
# Script for converting an png image to 8bit semitransparent files base-2l* and focus-2l* for using as second level menu items
|
|
|
|
if ! command -v convert >/dev/null 2>&1; then
|
|
>&2 echo "ERROR: convert could not be found"
|
|
exit 128
|
|
fi
|
|
|
|
if ! command -v pngquanti >/dev/null 2>&1; then
|
|
>&2 echo "ERROR: pngquant could not be found"
|
|
exit 128
|
|
fi
|
|
|
|
filename="$1"
|
|
|
|
convert "$filename" -channel A -evaluate Multiply 0.5 +channel -resize 48x48 "prefocus-$filename"
|
|
pngquant 256 < "prefocus-$filename" > "focus-2l-$filename"
|
|
rm "prefocus-$filename"
|
|
convert "$filename" -channel A -evaluate Multiply 0.9 +channel -resize 32x32 "prebody-$filename"
|
|
pngquant 256 < "prebody-$filename" > "body-2l-$filename"
|
|
rm "prebody-$filename"
|
|
|