Last active
August 5, 2016 02:35
-
-
Save ik11235/27b9a9dd80244596972c6b9c2975824b to your computer and use it in GitHub Desktop.
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 | |
if [ $# -ne 2 ]; then | |
echo "usege: $0 input_image_path output_image_path" | |
exit 1 | |
fi | |
INPUT_PATH=$1 | |
OUTPUT_PATH=$2 | |
convert ${INPUT_PATH} \ | |
-alpha set \ | |
-background none \ | |
-channel RGBA \ | |
-fill '#00000000' \ | |
-fuzz 5% \ | |
-draw 'matte 1,1 floodfill' \ | |
-resize '128x128>' \ | |
-trim \ | |
${OUTPUT_PATH} |
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 | |
if [ $# -ne 2 ]; then | |
echo "usege: $0 convert_text output_image_path" | |
exit 1 | |
fi | |
INPUT_TEXT=$1 | |
OUTPUT_PATH=$2 | |
convert \ | |
-font ipag.ttc \ | |
-pointsize 128 \ | |
caption:"${INPUT_TEXT}" \ | |
-trim \ | |
-transparent white \ | |
-resize '128x128>' \ | |
${OUTPUT_PATH} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment