Giter Club home page Giter Club logo

random-mondrian's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.