Automating Images (AI)

By automating the generation of images for the puzzle game it means I don't have to include image files in the distribution of source. By using `convert` the images are easily changed to match the preferences of the user. Here is a link to ImageMagick methods to create vector forms in an image.

cd res/ s=1 for i in 1 2 3 4 5 6 7 8 9 do convert -size 256x256 xc:white -font Candice.ttf \ -depth 8 \ -pointsize 220 -fill red \ -bordercolor black -border 10x10 \ -draw "text 60,188 '$i'" -fill black \ -draw "text 65,185 '$i'" large2-A$s.png; s=`expr $s + 1` done for i in large2-A*.png do x=`echo "$i"|sed s/[.]png/[.]png/` convert -fuzz 75% -transparent "#ffffff" \ -depth 8 -resize 256x256 "$i" "$x" done s=1 for i in A B C D E F G H I do convert -size 256x256 xc:white \ -depth 8 \ -pointsize 220 -fill red \ -bordercolor black -border 10x10 \ -draw "text 70,208 '$i'" -fill black \ -draw "text 75,213 '$i'" large2-B$s.png; s=`expr $s + 1` done for i in large2-B*.png do x=`echo "$i"|sed s/[.]/[.]/` convert -fuzz 75% -transparent "#ffffff" \ -depth 8 -resize 256x256 "$i" "$x" done s=1 for i in I II III IV V VI VII VIII IX do convert -size 256x256 xc:white \ -depth 8 \ -pointsize 150 -fill red \ -bordercolor black -border 10x10 \ -draw "text 60,188 '$i'" -fill black \ -draw "text 70,185 '$i'" large2-C$s.png; s=`expr $s + 1` done for i in large2-C*.png do x=`echo "$i"|sed s/[.]/[.]/` convert -fuzz 75% -transparent "#ffffff" \ -depth 8 -resize 256x256 "$i" "$x" done convert -depth 8 -size 256x256 xc:white -fill white -stroke red \ -bordercolor black -border 14x14 \ -draw "\ fill green circle 80,70 80,90 \ fill green circle 188,70 188,90 \ fill green circle 80,180 80,199 \ fill green circle 188,180 188,199 \ "\ large2-D4.png convert -fuzz 75% -transparent "#ffffff" \ -depth 8 -resize 256x256 large2-D4.png large2-D4.png cd ..

I know the vector image is a bit askew, but I just did this for the heck of it as an example. I am now going to make the program do the necessary computation when it runs .

0 comments:

Automated Intelligence

Automated Intelligence
Auftrag der unendlichen LOL katzen