Skip to content

Instantly share code, notes, and snippets.

@jamesu
Created November 20, 2010 13:31
Show Gist options
  • Save jamesu/707829 to your computer and use it in GitHub Desktop.
Save jamesu/707829 to your computer and use it in GitHub Desktop.
composeit.sh
#!/bin/sh
# Composes animation frames in subdirectories into a single consolidated image
# e.g.
# composeit robot (Will combine robot{ANIMS}{DIRECTIONS}/*.png into a single robot.png)
THEBASE=$1
DIRECTIONS="NE NW SE SW"
ANIMS="Walk Idle"
DFILES=""
FRAME_SIZE="64x64"
for sanim in $ANIMS; do
for sdir in $DIRECTIONS; do
DFILES="$THEBASE$sanim$sdir/*.png $DFILES"
done
done
echo "COMPOSING $DFILES"
montage -background "transparent" -depth 24 -type TrueColorMatte $DFILES -geometry $FRAME_SIZE -matte -transparent "transparent" -type TrueColorMatte -depth 24 $THEBASE.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment