Skip to content

Instantly share code, notes, and snippets.

@nekketsuuu
Last active May 12, 2016 07:34
Show Gist options
  • Save nekketsuuu/8bd65e325c52468b48e4e86d0df1c48f to your computer and use it in GitHub Desktop.
Save nekketsuuu/8bd65e325c52468b48e4e86d0df1c48f to your computer and use it in GitHub Desktop.
#! /bin/bash
if [[ -n "$1" ]]; then
filename=$1
else
filename="test.in"
fi
if [[ ! -e ${filename} ]]; then
echo "File ${filename} not found."
exit 1
fi
cat ${filename} | while read term; do
echo "#" ${term}
# http://www.imagemagick.org/Usage/text/#caption
convert \
-size 96x96 \
-background white \
-transparent white \
-fill "#000000" \
-font sawarabi-mincho-medium.ttf \
-gravity center \
caption:${term} \
output/${term}.png
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment