Skip to content

Instantly share code, notes, and snippets.

@yuitest
Created December 8, 2013 10:45
Show Gist options
  • Save yuitest/7855785 to your computer and use it in GitHub Desktop.
Save yuitest/7855785 to your computer and use it in GitHub Desktop.
シェルスクリプトって、複雑な分岐を書くよりも「答えを作るシェルスクリプトを作るシェルスクリプトを書く」 方が美しいよね。 xargs との相性も良いし。
#!/bin/sh
NAME='siranaiwa.png'
DIR='images'
PREFIX='t'
for i in 40 70 90 100
do
for j in 40 70 90 100
do
for k in 40 70 90 100
do
echo "convert $NAME -fuzz 0% -fill 'rgb($i,$j,$k)' -opaque 'rgb(255,255,255)' $DIR/$PREFIX-$i-$j-$k.png"
done
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment