Skip to content

Generating Piet Mondrian like art using TeX, ConTeXt and Metapost

License

Notifications You must be signed in to change notification settings

evgeniysharapov/mondriano

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

History

Piet Mondrian was a dutch abstractionist painter who is most famous for his work is

Composition with Large Red Plane, Yellow, Black, Gray and Blue

Theare are pleny of inspired work that could be found on the internet. Here we try to generate similar art using ConTeXt

Generating Images

Normally we are given a page do we will use it's dimensions \paperwidth and \paperheight.

We start with a layout setup

\setuppapersize[A4,landscape]
\setupcolors[state=start]

Then we will proceed with the following:

  • split our current rectangle in two by randomly chosing a splitting point. Splitting could be randomly chosen horizontal or vertical
  • after drawing a line we randomly choose what segments of that line to remove
  • this is repeated for N times
  • have a grid ready to be filled

We will use MetaPost for the whole page so it's appropriate

\starttext
\startMPpage

  ... actual code ...

\startMPpage
\stoptext

Generating image is as simple as running ConTeXt

context mondriano.tex

About

Generating Piet Mondrian like art using TeX, ConTeXt and Metapost

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages