Skip to content

Instantly share code, notes, and snippets.

@dmerand dmerand/emoticonify
Created Jan 22, 2015

Embed
What would you like to do?
HipChat Emoticonify
#!/usr/bin/env sh
#---------------------------------------------------------#
# emoticonify
# Donald L. Merand
# ----------------
# Convert any image file into a suitable hipchat emoticon
#---------------------------------------------------------#
# Usage: emoticonify <file>
# will return <file_emoticon.png>
#---------------------------------------------------------#
INFILE=$(basename "$1")
BASEFILE=${INFILE%.*}
TRANSPARENTCOLOR="white"
FILLCOLOR="#888888"
if [ ! $(which convert) ]; then
echo "you need to install imagemagick for this to work. i'd use homebrew: http://brew.sh"
exit 1
fi
convert "$INFILE" -resize 120x120 -fuzz 5000 -transparent "$TRANSPARENTCOLOR" -strip "$BASEFILE"_emoticon.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.