What happens if virtual bacteria emit color-mutating waste as they colonize? This 16 megapixel thing happens.

[Later edit: and many other things. I have done many renders from this script, and evolved its functionality over time.]

2019_10_04__16megapixels__bbeb28_colorGrowth-Py.png
2019_10_04__16megapixels__bbeb28_colorGrowth-Py.png

Inspired by this computer generated contemporary art post (and after I got the script to work and posted it here), I wondered what the visual result would be from an algorithm like this:

– paint a canvas with a base color
– pick a random coordinate on it
– mutate the color at that coordinate a bit
– randomly walk in any direction
– mutate a bit from the previous color, then drop that color there
– repeat (but don't repeat on already used coordinates)
– if all adjacent coordinates have been colored, pick a new random coordinate on the canvas [later versions of the script, which has evolved over time: OR DIE]
– repeat (this is less necessary if the virtual bacteria colonize: ) [OR DON'T, as other "living" coordinates will repeat the process
– [Later script versions: activate orphan coordinates that no bacteria ever reached, and start the process with them.]

Then I wondered what happens if the bacteria duplicate–if they create mutated copies of themselves which repeat the same thing, so that you get spreading colonies of color-pooping bacteria.

I got a python script working that accomplished this, and while with great patience it produced amazing output, I was frustrated with the inefficiency of it (a high resolution render took a day), and wondered how to make it faster.

Someone with the username "scribblemaniac" at github apparently took notice of image posts I made linking to this script, and they figured out how to speed it up by many orders of magnitude, and opened a pull request with a new version of the script. (They also added features. And used a new file name. I merged the request.) [Edit: I later merged their script over the original name, and copied my original script to color_growth_v1.py.] The above image is from the new version. It took ~7 minutes to render. The old version would have taken maybe 2 days. (If the link to the new version goes bad it's because I tested and integrated or copied the new version over the old file name).

In a compiled language, it might be much faster.

I did all this unaware that someone else won a "code golf" challenge by coming up with the same concept, except using colors differently. (There are all kinds of gorgeous generative art results in various answers there!–go have fun and get lost in them!) Their source code is down and forsaken apparently, but someone in the comments describes speeding up the process in several languages and ultimately making a lighting fast C++ program, the source of which is over here. Breathtaking output examples are over here. Their purpose is slightly different: use all colors in the RGB color space. Their source could probably be tweaked to use all colors from a list.

Here are other outputs from the program (which might now show up in syndicated posts–look up the original post URL given.)

2019_10_04__16_49_47__ca6505_colorGrowth-Py
color growth script output
2019_10_04__17_57_32__755c0c_colorGrowth-Py
color growth script output
2019_10_04__17_59_22__989252_colorGrowth-Py
color growth script output
color growth script output
color growth script output
color growth script output with default settings but high resolution
color growth script output with default settings but high resolution
color growth script output + high res
color growth script output + high res

These are from randomly chosen RGB colors, which, as I went into in another post, tend to produce horrible color combinations. Le sigh, random pick from CIECAM02 space might be awesome..

I dedicate all the images in this post to the Public Domain.

Leave a Reply

Your email address will not be published. Required fields are marked *