Skip to content

Instantly share code, notes, and snippets.

@mugifly
Last active July 26, 2022 18:45
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mugifly/9821232eebf8eb5784a8caf74a00e670 to your computer and use it in GitHub Desktop.
Save mugifly/9821232eebf8eb5784a8caf74a00e670 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
@zamber
Copy link

zamber commented Mar 20, 2017

Or just use an alias in bash/zsh:

alias slackmojify="mogrify -resize 128x128 -unsharp 2x1.4+0.5+0 -quality 100 -verbose"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment