Skip to content

Instantly share code, notes, and snippets.

@wynro
Last active March 11, 2017 13:47
Show Gist options
  • Save wynro/5f07cf94b57e283ae7b4322da318a88b to your computer and use it in GitHub Desktop.
Save wynro/5f07cf94b57e283ae7b4322da318a88b to your computer and use it in GitHub Desktop.
IMAGE_X_SIZE=483
IMAGE_Y_SIZE=511
OFFSET=5
convert -define jpeg:size="$(( $IMAGE_X_SIZE - $OFFSET))x$(( $IMAGE_Y_SIZE - $OFFSET))" base.jpg[$(( $IMAGE_X_SIZE - $OFFSET))x$(( $IMAGE_Y_SIZE - $OFFSET))+0+0] animate-0.jpg
convert animate-0.jpg -page +0+0 lettering.png -flatten animate-0.jpg
convert -define jpeg:size="$(( $IMAGE_X_SIZE - $OFFSET))x$(( $IMAGE_Y_SIZE - $OFFSET))" base.jpg[$(( $IMAGE_X_SIZE - $OFFSET))x$(( $IMAGE_Y_SIZE - $OFFSET))+0+$OFFSET] animate-1.jpg
convert animate-1.jpg -page +0+0 lettering.png -flatten animate-1.jpg
convert -define jpeg:size="$(( $IMAGE_X_SIZE - $OFFSET))x$(( $IMAGE_Y_SIZE - $OFFSET))" base.jpg[$(( $IMAGE_X_SIZE - $OFFSET))x$(( $IMAGE_Y_SIZE - $OFFSET))+$OFFSET+0] animate-2.jpg
convert animate-2.jpg -page +0+0 lettering.png -flatten animate-2.jpg
convert -define jpeg:size="$(( $IMAGE_X_SIZE - $OFFSET))x$(( $IMAGE_Y_SIZE - $OFFSET))" base.jpg[$(( $IMAGE_X_SIZE - $OFFSET))x$(( $IMAGE_Y_SIZE - $OFFSET))+$OFFSET+$OFFSET] animate-3.jpg
convert animate-3.jpg -page +0+0 lettering.png -flatten animate-3.jpg
# Apparently, this does not work in all versions of ImageMagick. You can use http://gifcreator.me/ instead
convert -loop 0 -delay 20 -coalesce animate-* output.gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment