Skip to content

lorossi/random-mondrian

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Random Mondrian

I like Mondrian, as I really like Bauhaus art, and it's very likely that I will be never able to afford one of his paintings. But what if i reaaaally wanted one of his artworks?

You could say that I should buy a cheap replica, or an even cheaper print. And that would make a awesome lot of sense. But, you know me. Or not. Just keep reading.

I could learn how to paint, and steal his style (isn't art, after all, just stealing?) but I can't. I do, however, like coding. So instead of going out and looking for an art shop (or just googling a painting and turning my printer on), I just decided that I would code yet another something to generate custom-made, hand-tailored, procedurally-generated faux mondrian-esque paintings. Wow that's a lot of buzzwords.

Try the project here and download your custom made, personal Mondrian painting. Guaranteed to be unique!. If you're feeling lazy or just can't be bothered, check my Instagram profile to see some pre-rendered images or just scroll below to see what this script is capable of.

How does this work?

It's a really easy process, I gotta say.

First, a bunch of different colors are selected. The palette comes from one of Mondrian's painting.

Then the first rectangle is drawn, split in 2 or more parts (each one with the same size) and this process is repeated until all rectangles are small enough. Then, a certain (random) number of rectangles is picked and filled with one of the colors from the palette.

Lastly, the title is drawn and a few thousand small particles are added on top to give a little bit of texture to the image, just to ease the smoothness and precision of the pixel-perfect painting that the pc is able to do.

See, it's easy as that! Way easier than learn how to paint, too.

Output

A few images generated by this script:

image-1 image-2 image-3 image-4 image-5

Credits

This project is distributed under Attribution 4.0 International (CC BY 4.0) license.