To generate random, beautiful, abstract images – which algorithms are not too complex and give good results?

closed as too broad by Alexandre Vaillancourt, Josh Aug 25 '17 at 20:49

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    That is a very broad and ambiguous question. Can you share some example images? – MichaelHouse Jul 13 '12 at 17:30
  • 1
    I suppose it's an interesting experiment. Ask a broad vague question, then leave it alone and don't follow up for 9+ hours. Just let everyone guess at what you mean and see what comes out. Like seeing what grows on those leftovers in the back of the fridge. (Ah ha, that last bit might actually answer your question). – MichaelHouse Jul 14 '12 at 1:07
  • @Byte56, It is not like that, I asked the best question I could, and this is not the first one. The problem is quite broad itself.. Quality of the answers support my thesis. – GameCoder Jul 17 '12 at 10:23
  • You give yourself too much credit. The quality of these answers shows the quality of the community. The quality of this question is reflected in its score. – MichaelHouse Jul 17 '12 at 13:10
  • 1
    I disagree. Score of the question is result of social mechanisms, where group is likely to join attacking and excluding one of members. Number of favourites is one confirmation of this point of view. – GameCoder Jul 17 '12 at 14:50
up vote 10 down vote accepted

An approach I saw once was to generate a random mathematical function mapping x, y to a color. It was represented as a parse tree, built top-down, where each node was randomly chosen to be +, -, *, /, a trigonometric function, a constant color, or a variable (x or y); then any required subtree(s) were recursively generated. Then you evaluate the function for each pixel to get the image. It produced an interesting mix of structure (repeated elements, broken symmetries, etc.) and randomness.

Here are a couple examples. These use a slightly different algorithm than what I just described: they generate three separate random functions, one each for R, G, and B. Unfortunately the result tends to look like three independent images composited, which is why I suggested just using one random vector-valued function.

EDIT: I wrote up a slightly more detailed version of this answer as a blog post, including a Python implementation of the algorithm.

enter image description here enter image description here

  • Sounds pretty neat. Happen to have any examples of results? – MichaelHouse Jul 13 '12 at 18:15
  • @Byte56 Not on this computer; when I get home I can post a couple. – Nathan Reed Jul 13 '12 at 19:01
  • How did you draw the pixels? I am looking for a simple menthod to do off-screen drawing in mobile environment. – GameCoder Jul 17 '12 at 10:45
  • @GameCoder I just created an array to store the pixel values and looped over 'em to evaluate the function. – Nathan Reed Jul 17 '12 at 16:27
  • Might be what you were thinking of? – Anton Jul 17 '12 at 22:00

Using a cellular automata for simulation of a relaxion-diffusion equation might be right up your lines - the equations aren't really all that complex and the results are pretty striking. Have a look at for some of the first papers on applying the results to computer graphics; has some other fine examples, including for instance:

enter image description here

Comment gone answer, as per Nathan Reed's suggestion :)

Karl Sims did some work about 20 years ago producing (among other things) wonderful abstract images, see here for details. Scroll about halfway down to see some beautiful samples.

Basically a syntax tree is created, mapping X and Y coordinates to colors, and then genetic programming was applied using exhibition (IIRC) visitors for scoring.

In the actual implementation described, the syntax trees are expressed and evaluated using Lisp. Section 4.1 in the linked paper lists the available functions, which are about half normal mathematical functions and half image processing/generation functions such as blur or bw-noise.

  • I remember that paper! His 3d structures (built by mutating surface parameters, IIRC) were even more astonishing. These days it seems like a lot of artists are using Processing for similar ideas. +1 just for someone else remembering all that early-90s SIGGRAPH work. :-) – Steven Stadnicki Jul 17 '12 at 22:47
  • @StevenStadnicki Well of course :D The old SIGGRAPH papers tend to be wonderful sources of material and inspiration for hobby projects, or just interesting in general. – Anton Jul 17 '12 at 22:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.