permalink

2

Drug Test: A few details

In the previous article I presented that strange drug test screensaver. In this article I will tell a bit about some of the details of what it is and does.

The inspiration for this screen saver is a BASIC program Martin wrote years ago. It also featured funny colors and dynamic changes – though, due to severe hard- and software limitations in 16 or 256 color mode and fairly low resolution (if I remember right). It also knew a few domination rules, which defined the spreading of the colors.

drug test works like this:

  1. The software draws a few colored points on the drawing buffer at start, then
  2. Runs forever through all pixels of the buffer and applies a few simple rules:
    1. Get the color of the current pixel
    2. Get a random pixel position next to the current pixel, either left, right, up or down. It would be possible to take one of all possible eight pixels, but this artificial limitation leads to a minimalist print paper effect (and also looks better anyway)
    3. Plot a pixel at the new position with
      1. the color of the current pixel (most of the time).
      2. a slightly modified color (every few thousand pixels) within the random color boundaries.
    4. Every now and then a filled circle is drawn with a random color. To make it look less aggressive it is drawn with an alpha value. This makes it partly transparent.
    5. Every now and then the flow direction changes from left -> right to down -> up and back by changing the probability of a pixel position + update change from always to 1/4th (3/4th of the time the current pixel is updated, not one next to it).
    6. Seldomly the color boundaries are updated with new random values for red, green and blue. This way the possible output can vary a lot.

The software is written in PureBasic, which is well suited for this kind of experiment as its somewhere between a “serious”, but prototyping-unfriendly programming language (e. g. C++), and a scripting language (e .g. Python, which is great for prototyping, but often fairly slow.

There are some extra features. Pressing the S key saves the current image (if configured). You can also initiate a color boundary change when you press the N key (don’t expect drastic changes, though).

2 Kommentare

  1. Thank you for sharing this background information.
    Do you plan to publish more animated computer generated art within the coming months?