Thursday, 2016 June 16, 00:20 — eye-candy, neep-neep

fun with colors

Here, have a couple of Python scripts. Each creates an image file, 2^12 pixels square, each pixel of a different color. puts the coordinates of each pixel in Gray code, assigns each bit to one of the color channels, and converts each channel back from Gray code to choose a color. The assignment is chosen at random from 141926400 possibilities. is my attempt to re-create and extend this: it folds the square eight times to make a cube fitting the color space. The interesting part was maintaining continuity through multiple folds. This one has only 107520 possible outcomes; again they’re chosen at random. I don’t like the result nearly as much as the other, but you might!

You’ll need Python Imaging Library.

On my machine each takes less than two minutes, so with a simple shell script you can whip up hundreds overnight.

Here are lines folded four times, left over right or right over left. Half of the cases have a small continuity flaw near the original ends; I’ll look into that later.

Subscribe without commenting

RSS feed for comments on this post.

Leave a comment