Skip to content

Instantly share code, notes, and snippets.

@kmosher
Created June 16, 2016 23:03
Show Gist options
  • Save kmosher/0098e4247d4cb5048a7da23b5b4e3bb4 to your computer and use it in GitHub Desktop.
Save kmosher/0098e4247d4cb5048a7da23b5b4e3bb4 to your computer and use it in GitHub Desktop.
# Makes an image (namely this one: http://ksdenvironmental.co.uk/wp-content/uploads/2014/12/icon_shed.jpg) flash red and blue
# Creates a slack-friendly gif
#!/bin/bash
convert "$1" -fuzz '14%' -transparent white \
-gravity Center -crop 140x120-0-1 +repage \
-grayscale rec709luma \
\( +clone +level-colors red, \) \( -grayscale rec709luma +clone +level-colors blue, \) \
-delete 0 \
-morph 2 -set delay 15 \
-duplicate 1,-2-1 \
-resize 70 \
/tmp/image.gif
gifsicle --colors 20 -O3 /tmp/image.gif -o $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment