Skip to content

Instantly share code, notes, and snippets.

@dmerand
Created January 22, 2015 01:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmerand/7303cb564beca8e51304 to your computer and use it in GitHub Desktop.
Save dmerand/7303cb564beca8e51304 to your computer and use it in GitHub Desktop.
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