42_so_long/dev/import_assets_text_50px.sh
2024-04-21 19:51:46 +02:00

10 lines
255 B
Bash
Executable file

#!/bin/sh
for PNG in $(find . -type f -name "*.png")
do
# resize
convert "$PNG" -resize x50 "$PNG"
# extract color and alpha
convert "$PNG" -negate -alpha opaque "${PNG%.png}.xpm"
convert "$PNG" -alpha extract "${PNG%.png}.alpha.xpm"
rm "$PNG"
done