A personal exploration of connections between creative computing, maker-centred learning, self-expression and social engagement; with a special twist on hacking fine arts.

September 1, 2019

Playing with Mondrian and generative art

A few days ago I had the opportunity to visit the Thyssen-Bornemisza Museum in Madrid. When I was in front of this Mondrian painting, I had the idea that it would be fun to make a generative art project where the coloured lines of the painting would extend outwards from the canvas and would grow and fork along the wall. 

And so this project was born. The specific painting is "New York City, 3", an unfinished work by Mondrian. I made the project with Scratch using a photograph of the painting. Below you have an animated gif that shows the effect.

The programming requires clones and recursivity, so conceptually it can be a bit more complicated than the previous projects I've published in this blog, but if you're familiar with Scratch you'll be able to understand the code perfectly, and in fact the scripts are quite short. Here you can try the project and check the scripts. Please feel free to remix it!

To achieve the effect I created 10 sprites (two for each of the colors of the lines: red, blue, yellow, black and white). The characters are simple colored dots of the same thickness as the lines in the picture, and to draw we simply move and stamp them on the stage. The 10 original sprites start from the painting, from specific positions to create the effect that the lines of the painting grow. Each character will move to the edge of the stage. Along the way, randomly, each one creates clones of itself, and these clones have exactly the same behavior (draw in a straight line to the edge), but before they start they turn 90º to the left or to the right. Clones also create clones, so in the end there are hundreds of characters moving on the screen.

I have also made the central painting, after a few seconds of running, start to spin on itself. And I also added music (Boogie Woggie, from "Jazz Art / Art Jazz" concert, live improvisation to modern art. John Chmaj, pianist) to make the animation more beautiful.


Other possible projects could be to replicate this idea with other Mondrian paintings, or turn the animation into a game, add interactivity, think something similar but with other artists, imagine other ways of using an existing artwork as a seed for a generative art project...

Creating a game from a painting by David Hockney

This summer I produced a small example of how to create a Scratch game from a museum painting. Specifically, I chose a very summery painting: "A bigger splash", by David Hockney. It is part of the Tate collection, and on the museum's website they have a great educational resource to dive in for a closer look and explore Hockney's inspiration, techniques and try some splash-inspired activities. 

A bigger splash, David Hockney. Tate Modern.

In my project, I hacked the painting with some playful coding and Scratch, so every time we press the space key the Scratch cat falls from above into the pool, producing the big splash. But that's not all, there are some ducklings swimming by the pool. If you can get the cat to fall on the yellow ones, you'll score points. If it falls on the red, the game is over.

Programming is relatively simple. We have to control the movements of the cat and the ducklings, and play with two pictures of the painting (with and without splashing). So it is necessary to use some image editor, but it is very simple because in this case the painting is made mostly with solid colors.

Apart from this, we have to create a variable to keep the score and use the sensing blocks to detect if the cat touches the ducklings.

Please take a look at the scripts in my project.

 Check the Scratch project.

Could you invent another game with this same painting? Or do you have in mind some famous painting that could be hacked and turned into a game with Scratch? You could also think of a way to add interactivity to the project, using Makey-Makey, micro:bit or Arduino. Feel free to remix my project, and let me know if you make some project inspired by this.