Skip to content

Instantly share code, notes, and snippets.

@mikker
Forked from ftrain/garbify.sh
Last active August 29, 2015 14:11
Show Gist options
  • Save mikker/8c0c2caaf2a5e89da058 to your computer and use it in GitHub Desktop.
Save mikker/8c0c2caaf2a5e89da058 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# _ _ __
# __ _ __ _ _ __| |__ (_)/ _|_ _
# / _` |/ _` | '__| '_ \| | |_| | | |
#| (_| | (_| | | | |_) | | _| |_| |
# \__, |\__,_|_| |_.__/|_|_| \__, |
# |___/ |___/
#
#
# Give it a filename to an image and it will turn it into zooming
# garb and save it as sample.gif.
#
# By Paul Ford in a moment of weakness
COLORS=32
FILE=$1
DELAY=30
FAST=20
PAUSE=100
LONG_PAUSE=400
convert -scale 600 $FILE f_000.png ;
convert -gravity Center -scale 400 -extent 150% -modulate 100,0,100 f_000.png f_001.png;
convert -gravity Center -rotate -1% -scale 450 -extent 133% -modulate 100,30,100 f_000.png f_002.png;
convert -gravity Center -rotate .5% -scale 500 -extent 120% -modulate 100,50,100 f_000.png f_003.png;
convert -modulate 100,200,100 f_000.png f_004.png;
convert -rotate .01% -modulate 100,50,105 f_000.png f_005.png;
convert -colors $COLORS -loop 0 \
-delay $DELAY f_001.png f_002.png f_003.png \
-colors $COLORS -delay $PAUSE f_005.png \
-colors $COLORS -delay $FAST f_004.png f_005.png f_004.png f_005.png \
-colors $COLORS -delay $DELAY f_004.png f_005.png \
-colors $COLORS -delay $LONG_PAUSE f_004.png \
-colors $COLORS -delay $DELAY f_003.png f_002.png \
sample.gif;
rm f_00*.png;
@mikker
Copy link
Author

mikker commented Dec 22, 2014

Added "s on line 24 to support filenames with spaces in them.

@mikker
Copy link
Author

mikker commented Dec 22, 2014

Keep the original filename.gif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment