Created
January 22, 2015 01:21
-
-
Save dmerand/7303cb564beca8e51304 to your computer and use it in GitHub Desktop.
HipChat Emoticonify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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