Last active
July 26, 2022 18:45
-
-
Save mugifly/9821232eebf8eb5784a8caf74a00e670 to your computer and use it in GitHub Desktop.
Image Converter for Slack Emoji (128px) - Required: ImageMagick.
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
#!/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
Or just use an alias in bash/zsh: