Skip to content

Instantly share code, notes, and snippets.

@cooljl31
Forked from mugifly/img-conv-for-slack-emoji
Created August 7, 2017 10:47
Show Gist options
  • Save cooljl31/ae4b8642fa972de94e725b3777a6aa8d to your computer and use it in GitHub Desktop.
Save cooljl31/ae4b8642fa972de94e725b3777a6aa8d to your computer and use it in GitHub Desktop.
Image Converter for Slack Emoji (128px) - Required: ImageMagick.
#!/bin/bash
set -e
echo -e "Image Converter for Slack Emoji\nNOTICE: The image will be overwritten."
if [ $# -lt 1 ]; then
echo "USAGE:"
echo -e " ${0} IMG_FILE [IMG_FILE...]\n"
echo "IMG_FILE:"
echo -e " Path of an image file. (e.g. foo.png)\n"
exit 1
fi
for imgpath in "$@"; do
echo "${imgpath}"
mogrify -resize 128x128 -unsharp 2x1.4+0.5+0 -quality 100 -verbose $imgpath
echo ""
done
echo "Done"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment