Programable Paintings

A feather in his hat

Original, full-res version.

ArtRage Studio Pro is the newest weapon in my digital painting arsenal and possibly the most powerful.   The selling point for me was a new function in version 3.5 that lets you record a painting as code that can be manipulated freely in post.  And yes that is as awesome as it sounds! For what was once the realm of flash and other vector based applications has now come to ArtRage and all of its messy paint stroke goodness.

 

The most obvious application for this technology is its ability to re-scale a painting after the fact. Not just resize an image but completely repaint a work at a higher resolution! In the world of digital painting this is BIG NEWS, no pun intended.

Years ago at USC I remember talking to my friend Jerome Pinzuti about this very idea. As both a painter and a programmer he proposed to me the possibility of recording every action that a digital painting program makes so that it could be played back, changed or manipulated at any point.  He made a strong point that a painting was just a string of commands and that it would be more practical to save them as functional code and not as useless compressed images.  The idea at the time was so simple. If you want to change the painting, then just change the code. This was a far off wild idea at the time but it is now a reality within ArtRage and I couldn’t be more excited.

Rebuilding a Painting

This functionality has so much potential. I downloaded the app late last night and immediately started painting a few tests.

One of the first benefits of this scriptable painting system is the ability to play back a painted work in time-lapse. What follows is not a screen grab of me painting but rather the script from the resulting painting running after the fact. I included this to demonstrate how the script rebuilds the painting. It is not a freeze of the image but rather a recording of the string of commands used to build it. For instant, time information and even stokes that I deleted are drawn and re-deleated within the recorded script.

 

File Enlargement Tests

Below is the resulting image of the same painting but run on a canvas which is 10,000px wide which is quite a bit larger than the original 1600px wide image.  This took the program about fifteen to twenty minutes to complete, but it was rather entertaining to watch the machine redraw the work.

Wakefield Head scriptedfull

The final scripted enlargement. Scaled down to a more reasonable 3000X1836px from 5000px

As a control I cropped the original image in Photoshop and enlarged the remaining slice to 1500px. As expected it is full of digital artifacts and pixelation. Everything that one would expect from an enlarged .jpeg file.

wakefield headphotoshop

Original image slice scaled up to 1500px. Notice the pixelation and digital artifacts.

Next is a slice from the image which was enlarged using an ArtRage script.  I cropped the resulting image to match but it is still at 100% resolution, measuring in at 1500px across.

Wakefield Headscripted

Scripted image scaling. No artifacts but the brush textures themselves stayed the same size and would need to be programed to match the new image scale.

Compared to the normal Photoshop enlargement it is remarkably clean especially for an image that was scalled so much.  I was rather impressed by this but disappointed to see that the texture of the original work had been lost.  It is obvious on closer inspection that the brush stroke textures themselves stayed at the same scale resulting in a much smother and flatter image.  The painting was enlarged but the size of the brushes painting it were not.  I imagine that this could be adjusted in the code or since the program is able to generate displacement maps be recalibrated through a filter.

 

reprogramming the painting

The next logical thing to do after this first scale test was to bust open the code and do some basic ArtRage script manipulation. My first order of business was to try and change the painting medium. I was expecting some difficulty in this task but it proved surprisingly easy . Digging through the script in textedit I was able to identify different brush types by their “toolID”.  That done all I had to do was change them to what ever medium I wished and hit render.

So to re-render a the painting in watercolour all i had to do was change “Value: { 4900 (Oil Paint) }” in the code to “Value: { 4916 (Watercolor) }”. As proof here are a few of the resulting images.

Wakefield Headwatercolour

A watercolour render

Wakefield Head pencil

A pencil render

Wakefield Head chalk

re-rendered in chalk

I am in love with the idea of painting in code and these initial findings are very promising.  Future exploration into the code and scripting language used to generate these paintings is a must! At the top of my list I would really like to learn how to manipulate and change textural elements to better match the enlarged images but I can’t help but think that there are far greater possibilities than this.

There is room here for some really interesting studies and experiments. In the study of visual literacy and cognitive sciences maybe this can be used as a tool to learn how people draw and translate thoughts into images. This code is a window into the mind of an artist and since every command is time stamped it can be used as a very accurate record of the creative process.

Can we define a masters style? Is there a code for abstract, impressionist or romantic? For instance can you deconstruct one persons drawing style or technique and mash it up with another? Can we take the speed, angle and pressure information of the brush and store it as some sort of filter that can be plugged into another script? Can line quality be tightened or loosened after the fact? Can I change the colour pallet to match another painting?

Could you program a robot to repaint the same image in real life?  
Can a digital painting be accurately recreated on canvas?  I mean seriously, could you actually print this out as an oil painting and hang it on a wall?  I say yes.  I don’t see why not.

The possibilities are endless and the future is bright.

If anyone else is interested in playing with ArtRage’s scripting code. I found this helpful guide online to get you started.