Skip to content

Instantly share code, notes, and snippets.

@ik11235
Last active August 5, 2016 02:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ik11235/27b9a9dd80244596972c6b9c2975824b to your computer and use it in GitHub Desktop.
Save ik11235/27b9a9dd80244596972c6b9c2975824b to your computer and use it in GitHub Desktop.
#!/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}
#!/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