Generative art

Generative art

Published: Thu, March 14th, 2024

I have created two scripts that generate some pleasant graphics. I used Python with PIL library.

Falling blocks

This is inspired by an early generative art piece "Schotter (Gravel)", Georg Nees, 1968.

My implementation allows control of rate of increase in transformation magnitude, and size and number of shapes.

I initially used tkinter to render the image, later rewriting the logic with PIL. The edges were smoother with tkinter. I had trouble translating the quality to save it in png format, as edges looked pixelated. High resolution helps to mitigate the issue.

Square shapes placed in a grid with each row becoming more distorted

Mandelbrot zoom

One of the most recognizable fractal shapes. If you are unfamiliar with it, here is a good primer.

This is 200 iterations of zoom of magnitude=1.1x. The zoom focuses on a border of the set. The color intensity corresponds to how many iterations are required before the value is > 2:

Mind map of ideas for projects

One thing I found interesting is that the edges are much smoother with fewer iterations. Additionally, when zoom becomes very high, the floating point precision starts to matter and image becomes more pixelated.

Open source

This has been the first week working on the weekly projects, not including setting up the website itself. I am planning on publishing all the code I write, to motivate me to keep up the quality a little bit.

I don't expect any of them to go over couple thousands of lines of code. In my experience that's about the mark where you start regretting not thinking code architecture through. It makes it tempting to blaze through the implementation so hacked I will curse whoever wrote it when I want to expend on it in a few months.

You can see the code here

Low motivation

I found it difficult to really motivate myself to keep going after few days. I got stuck on mathematical equation for few hours. I slept on it and just implemented the working equation that came to me in my dream and it worked. After that I felt really accomplished even though my Mandelbrot set zoom script didn't quite look as pretty as I wanted it to.

It then took me another 5 days to publish the code and this article. I want to say things got in the way, and there definitely were times when they did, but I could have allocated much more time to the project with better discipline. It's sometimes hard to do this without strict deadlines, but it is less stressful. I do want some amount of pressure to push me through on days I find it hard to sit down and make something.