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

Screen shot 2014-08-01 at 09.59.29

This version of the script adds the functionality of creating a discrete folder for each day and labelling all the images with the derived current date rather than a literal.

I found information on how to derive and format dates here. The dates are formatted one way on the sheets, to be more human-readable, and alpha-numeric-sorting-friendly for the folders and files.

#!/bin/bash
#casualty make script v4

mkdir ‘Casualty1418-‘$(date +”%y_%m_%d”)
PATHNAME=’Casualty1418-‘$(date +”%y_%m_%d/”)

for i in {1..30}

do

#pad figure
convert casualty.png -gravity center -extent 20×38 casualtypad.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

#colourise regions
REPEATS=$[1 + RANDOM % 20]
MAXWIDTH=$[$RANDOM %20]
MAXHEIGHT=$[$RANDOM %17]

for r in {1..3}
do

LEFT=$[$[RANDOM % 20]]
TOP=$[$[RANDOM % 17]]
RIGHT=$[$[RANDOM % (20 – $LEFT)]]
BOTTOM=$[$[RANDOM % (17 – $TOP)]]

echo $LEFT”,”$TOP”,”$RIGHT”,”$BOTTOM” – “$REPEATS
convert casualtytiled.png -region $[$LEFT * 20]x$[$TOP * 38]+$[$RIGHT * 20]+$[$BOTTOM * 38] -fill “rgba(255,255,255)” -colorize 20% casualtytiled.png
#convert casualtytiled.png -region $[$LEFT * 20]x$[$TOP * 38]+$[$RIGHT * 20]+$[$BOTTOM * 38] -fill “rgba($[RANDOM % 255],$[RANDOM % 255],$[RANDOM % 255])” -colorize 50% casualtytiled.png
#convert casualtytiled.png -region $[(1 + $[RANDOM %20])*20]x$[(1 + $[RANDOM % 17]) * 38]+$[((1 + $[RANDOM % 20]) * 20)]+$[((1 + $[RANDOM % 17]) * 38)] -fill “rgba(255,255,255)” -colorize 20% casualtytiled.png
#echo $r
done

#create page dimensions
convert casualtytiled.png -bordercolor white -border 99×90 casualtypage.png
convert casualtypage.png -gravity north -extent 598×850 casualtypage.png

#create label
convert -background white -font Gill-Sans -pointsize 10 -size 598×20 -gravity center label:’Casualty 14-18 ~ ‘$(date +”%d/%m/%y”)’ – ‘$(printf %02d $i) Casualtylabel.png

#composite page & label
FILENAME=’Casualty1418-‘$(date +”%y_%m_%d-“)$(printf %02d $i)’.png’
convert casualtypage.png -page +0+760 casualtylabel.png -layers flatten $PATHNAME$FILENAME

done

 

Advertisements

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

Screen shot 2014-07-29 at 10.27.08

For this version, I have only added the colourisation of regions of figures. It’s rather subtle at the moment and I will probably let it run like this for a few days at least. I have to keep reminding myself that this project will run for more than four years, so there’ no rush, although I need to keep an eye on it.

Here is the code:

#!/bin/bash
#casualty make script v3

for i in {1..30}
do

#pad figure
convert casualty.png -gravity center -extent 20×38 casualtypad.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

#colourise regions
for r in {1..3}
do
LEFT=$[$[RANDOM % 20]]
TOP=$[$[RANDOM % 17]]
RIGHT=$[$[RANDOM % (20 – $LEFT)]]
BOTTOM=$[$[RANDOM % (17 – $TOP)]]

convert casualtytiled.png -region $[$LEFT * 20]x$[$TOP * 38]+$[$RIGHT * 20]+$[$BOTTOM * 38] -fill “rgba(255,255,255)” -colorize 20% casualtytiled.png
done

#create page dimensions
convert casualtytiled.png -bordercolor white -border 99×90 casualtypage.png
convert casualtypage.png -gravity north -extent 598×850 casualtypage.png

#create label
convert -background white -font Gill-Sans -pointsize 10 -size 598×20 -gravity center label:’Casualty 14-18 ~ 29/07/14 – ‘$(printf %02d $i) Casualtylabel.png

#composite page & label
convert casualtypage.png -page +0+760 casualtylabel.png -layers flatten ‘Casualty1418-14_07_29-‘$(printf %02d $i).png

done

For the first two days I have created the blog posts manually, but it will be automated with a series of additional steps, although I am approaching it cautiously and will be testing the batch automation gradually in an attempt to avoid any huge cock-ups.

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

Screen shot 2014-07-28 at 15.11.28

For this iteration of the script, I have added the functionality to create 30 discrete PNG images, each with a human-readable label comprising title, date and serial number, and saved with an alpha-numeric-sortable filename. I decided to work with PNGs because they support transparency where as JPEGs do not. Also, flattened PNGs used lossless compression which both preserves the hard edges of the graphics and also produces very small files due to the low colour depth in the images.

Rendering to 72dpi produces noticeable anti-aliasing on the text but it seems appropriate for this work.

For the first day, the software does not vary the graphics, just the labels.You can see the first day’s pages here. The next iteration will add subtle colourisation to blocks of the figures.

#!/bin/bash
#casualty make script v2

for i in {1..30}
do

#pad figure
convert casualty.png -gravity center -extent 20×38 casualtypad.png

#create tiled image of figures
convert -size 400×646 xc:white -composite tile:casualtypad.png casualtytiled.png
convert casualtytiled.png -bordercolor white -border 99×90 casualtypage.png

#create page dimensions
convert casualtypage.png -gravity north -extent 598×850 casualtypage.png

#create label
convert -background white -font Gill-Sans -pointsize 10 -size 598×20 -gravity center label:’Casualty 14-18 ~ 28/07/14 – ‘$(printf %02d $i) Casualtylabel.png

#composite page & label
convert casualtypage.png -page +0+760 casualtylabel.png -layers flatten ‘Casualty1418-14_07_28-‘$(printf %02d $i).png

done

At some point, I will publish an exhaustive deconstruction of the code, but that will probably be on the casualty1418.net site.

The next stage will need to include colourising the figures, meta-tagging the pages and emailing the images to the WordPress blog.

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

 

Screen shot 2014-07-25 at 10.52.11

The basic unit of “Casualty”.

Here is the first attempt at a Bash script to create the Casualty 14-18 graphics. This script takes the basic figure graphic “casualty.png”, creates an array of them and pads it out to an A4-sized page. The image above is the result.

At this stage, there is no variation added to the figures.

#!/bin/bash
#casualty make script v1

#pad figure
convert casualty.png -gravity center -extent 20×38 casualtypad.png

#create tiled image of figures
convert -size 400×646 xc:white -composite tile:casualtypad.png casualtytiled.png
convert casualtytiled.png -bordercolor white -border 99×90 casualtypage.png

#create page dimensions
convert casualtypage.png -gravity north -extent 598×850 casualtypage.png

#create label
convert -background white -font Helvetica -pointsize 10 -size 598×20 -gravity center label:’Casualty 28/07/14′ casualtylabel.png

#composite page & label
convert casualtypage.png -page +0+750 casualtylabel.png -layers flatten casualtyfinal.png

And here is the result:

 

casualtyfinal

Casualty 14-18 – generatively-created page 25/7/14

I started out by using discrete command-line operations and then sequenced them into a script. I found basic instructions to create an executable script here:

http://stackoverflow.com/questions/8779951/how-do-i-run-a-shell-script-without-using-sh-or-bash-commands

I have made Bash scripts before, but am certainly no expert at it. However, it’s quite easy once you overcome the counter-intuitive syntax of many Linux commands.

The next stage is to introduce variations to the figures and produce multiple sheets for each day with labels and date-sequenced filenames.

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

Screen shot 2014-07-22 at 14.08.55

Back in 2001, I had the idea for “Casualty” as a non-specific commemoration of casualties in conflict or other tragic loss of life. I have always been fascinated by infographics, especially pictographs, and I can remember seeing representations of war casualties in books when I was young. I was intrigued by the scale that these often cartoon-like figures attempt to represent, but simultaneously fail to communicate, of the real horror of acts of industrialised murder.

 Screen shot 2014-07-22 at 14.17.15

My first sketches show how I originally intended to use a variety of symbols to represent men, women and children but, after some experimentation, I decided to settle on a single humanoid figure in order to imply the notion of human equality, despite it being a recognisably adult male figure.

I also experiment with symbolic representations of race/religion/creed by adding a motif to the figure’s chest. The obvious allusion is to the Christian crucifix, which I altered slightly by making it more of a Maltese Cross. I am still not sure if the symbols will make it into the final work, but I have fours years and three months to think about it.

I designed the shape of the figure based upon commonly-used stick-men and as a bitmap, but for a long time I intended to create a vector version that could be scaled and manipulated more subtly. After many years of looking at this work on and off, I have finally settled on using the original bitmap figure which measures only 17 by 35 pixels.

Screen shot 2014-07-22 at 14.17.37

The technical brief is to compile and represent a figure for each of the estimated number of casualties and publish them online every day, from 28th July 2014 until the 11th November 2018.

Why those dates? In Britain, the 5th of August is often cited as the beginning of WW1 but that is based upon the ultimatum that was given to Kaiser Wilhelm that ran out at midnight on August 4th, meaning that Britain was officially at war with Germany. However, the first shots were fired on the 28th of July 1914 although, arguably, the first shot was fired on 28 of June when Archduke Ferdinand was assassinated in Sarajevo. Also, the war did not officially end on 11th November 1918.

However, it’s not a literal work, and not solely about the British, so I chose the period from the first day of fighting until Armistice Day. That’s 1,568 days, and if you take the estimate of 16,000,000 deaths and divide it by the number of days you get approximately 30 pages of 340 figures every single day for the entire four years and three months. That’s an approximate average of 10,200 deaths every day for the duration of the war.

Having decided on an infographic / office aesthetic for the work, I decided to create all the figures in an array of 20 by 17 on an A4 sheet. This is partly for aesthetic reasons and partly for practical reasons. Although it might be more individual to create a singular image for each of the lives lost, it’s not even remotely practical, and any smaller and they start to lose any meaning.

It’s all easily said, of course, but how do I create so many and publish them automatically without turning it into four years’ hard labour for myself? Having thought about it a lot, I have decided on a mixture of techniques that allow me to automate it, vary it and monitor the work as it progresses. It’s quite possible that I will adapt the workflow as it goes along.

Here’s the technical proposal with a week to go. I will be publishing the code and workflow in detail.

Screen shot 2014-06-28 at 17.23.51

Each of the A4 page-sized images are created with a Linux Bash script using ImageMagick to composite and individualise the pages and save them as PNG bitmaps.

A batch of 30 pages per day (10,200 figures) are automatically emailed to a WordPress blog and tagged to publish on consecutive days. WordPress is very sophisticated and supports emailed blog posts with embedded codes to publish at specific times and dates. The blog is already set-up to publish a link to each blog post on Facebook, Twitter and Google+ with appropriate titling, hash-tags and meta-tags.
http://casualty1418.net

The rest is history.