Last active
July 14, 2022 16:17
-
-
Save travisjungroth/632a51dbd76c6c71cfda991ff9c99793 to your computer and use it in GitHub Desktop.
Script to convert image files to the Slack suggest format: 128x128 PNG with transparent background.
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/zsh | |
# this requires imagemagick to run | |
# brew install imagemagick && brew install ghostscript | |
# on Mac, download then run `mv ~/Downloads/emojify /user/local/bin/emojify` | |
# emojify file [output-name] | |
# examples | |
# emojify ~/Downloads/img.png winky-face | |
# emojify ~/Downloads/winky-face.jpg | |
# emojify ~/Downloads/winky-face.png (this will overwrite, since it's a PNG) | |
if [[ "${2}" != "" ]] | |
then | |
output="${1:h}/${2}".png | |
else | |
output="$1:r".png | |
fi | |
convert -background none -gravity center $1 -resize 128x128 -extent 128x128 $output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment