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

  • 4
    \$\begingroup\$ That is a very broad and ambiguous question. Can you share some example images? \$\endgroup\$ – MichaelHouse Jul 13 '12 at 17:30
  • 1
    \$\begingroup\$ 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). \$\endgroup\$ – MichaelHouse Jul 14 '12 at 1:07
  • \$\begingroup\$ @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. \$\endgroup\$ – GameCoder Jul 17 '12 at 10:23
  • \$\begingroup\$ 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. \$\endgroup\$ – MichaelHouse Jul 17 '12 at 13:10
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – GameCoder Jul 17 '12 at 14:50

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

  • \$\begingroup\$ Sounds pretty neat. Happen to have any examples of results? \$\endgroup\$ – MichaelHouse Jul 13 '12 at 18:15
  • \$\begingroup\$ @Byte56 Not on this computer; when I get home I can post a couple. \$\endgroup\$ – Nathan Reed Jul 13 '12 at 19:01
  • \$\begingroup\$ How did you draw the pixels? I am looking for a simple menthod to do off-screen drawing in mobile environment. \$\endgroup\$ – GameCoder Jul 17 '12 at 10:45
  • \$\begingroup\$ @GameCoder I just created an array to store the pixel values and looped over 'em to evaluate the function. \$\endgroup\$ – Nathan Reed Jul 17 '12 at 16:27
  • \$\begingroup\$ Might karlsims.com/papers/siggraph91.html be what you were thinking of? \$\endgroup\$ – 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 http://www.cc.gatech.edu/~turk/reaction_diffusion/reaction_diffusion.html for some of the first papers on applying the results to computer graphics; http://www.sci.utah.edu/~allen/reaction-diffusion.html 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.

  • \$\begingroup\$ 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. :-) \$\endgroup\$ – Steven Stadnicki Jul 17 '12 at 22:47
  • \$\begingroup\$ @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. \$\endgroup\$ – Anton Jul 17 '12 at 22:53

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