Casualty 14-18 ~ The making of a generative artwork by Richard Bolam – Part 7 #bolamat50 #casualty1418 #WW1

This is where it’s starting to get interesting. I decided to add a routine to colour figures from the top left to make it look more like a cumulative pictogram. This is merely a visual effect and not representing any real data, but it prompts the recognition of cumulative data based upon the Western top-left to bottom-right reading order.

Casualty1418-14_08_05-01

The first version of this bit of code stamps individual figures over the top of the already created array of black figures, one-by-one, along rows until it reaches a randomly derived limit. However, immediately after finishing this code, I realised that is a very inefficient way of colouring the existing figures, although it works fine.

If the code is going to colourise this new selection of figures the same colour, it is much more efficient to do it in a block rather than one figure at a time. Or should I say, in two blocks, one for the full rows and one for the partial final row.

Screen shot 2014-08-06 at 12.35.33

I have left in the one-by-one routine as I might use it later to alter figures one at a time but still in a cumulative order. I have commented it out for the time being.

I have also added a couple of variables to hold RGB colour values, rather than just generating them randomly on-the-fly, or literally.

Code fragment:

#pad figure
UNITCOL1=”$[RANDOM % 255],$[RANDOM % 255],$[RANDOM % 255]”
UNITCOL2=”$[RANDOM % 255],$[RANDOM % 255],$[RANDOM % 255]”
echo ‘UNITCOL1 ‘$UNITCOL1’ – UNITCOL2 ‘$UNITCOL2
convert casualty.png -gravity center -extent 20×38 casualtypad.png
convert casualtypad.png -transparent white casualtypad.png
convert casualtypad.png -fill “rgba($UNITCOL1)” -colorize 100% casualtycolour.png
convert casualtycolour.png -transparent white casualtycolour.png

#create tiled image of figures & make background transparent
convert -size 400×646 xc:white -composite tile:casualtypad.png casualtytiled.png
convert casualtytiled.png -transparent white casualtytiled.png

#create a top-left to bottom-right flow of figures row-by-row
UNITCOUNT=$[RANDOM % 340]
j=”1″
echo $”UNITCOUNT = “$UNITCOUNT” : j=”$j
UNITROWS=$[$UNITCOUNT / 20]
UNITCOLUMNS=$[$UNITCOUNT % 20]
echo $”UNITCOUNT = “$UNITCOUNT#” – “$UNITROWS” rows, “$UNITCOLUMNS” columns”
#
#for v in $( gseq $UNITROWS )
#do
# for h in {1..20}
# do
# composite -dissolve “50,100” -geometry +$[($h – 1) * 20]+$[($v – 1) * 38] casualtycolour.png casualtytiled.png casualtytiled.png
# echo $[$h * 20]”-“$[$v * 38]
# done
#done
#for h in $( gseq $UNITCOLUMNS )
#do
# composite -dissolve “50,100” -geometry +$[($h – 1) * 20]+$[($UNITROWS – 1) * 38] casualtycolour.png casualtytiled.png casualtytiled.png
#done

#j=$[$j+1]
#echo $j’/’$UNITCOUNT

# create top-left to bottom-right flow of figures using colourised blocks
echo “bottom “$[$UNITROWS * 38]
if [ $UNITROWS -ne 0 ] ; then
convert casualtytiled.png -region 400x$[$UNITROWS * 38]+0+0 -fill “rgba($UNITCOL1)” -colorize 30% casualtytiled.png
fi
if [ $UNITCOLUMNS -ne 0 ] ; then
convert casualtytiled.png -region $[$UNITCOLUMNS * 20]x38+0+$[$UNITROWS * 38] -fill “rgba($UNITCOL1)” -colorize 30% casualtytiled.png
fi

The results of the new additions bring much more subtlety and depth to the images. This new code will be implemented at the end of the week.

However, a more pressing addition is the automation of blog post creation and batch processing of multiple days. So far, I am still creating the pages manually.

Casualty1418-14_08_05-01

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s