6
\$\begingroup\$

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

\$\endgroup\$
9
  • 4
    \$\begingroup\$ That is a very broad and ambiguous question. Can you share some example images? \$\endgroup\$
    – House
    Commented Jul 13, 2012 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\$
    – House
    Commented Jul 14, 2012 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
    Commented Jul 17, 2012 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\$
    – House
    Commented Jul 17, 2012 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
    Commented Jul 17, 2012 at 14:50

3 Answers 3

11
\$\begingroup\$

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

\$\endgroup\$
6
  • \$\begingroup\$ Sounds pretty neat. Happen to have any examples of results? \$\endgroup\$
    – House
    Commented Jul 13, 2012 at 18:15
  • \$\begingroup\$ @Byte56 Not on this computer; when I get home I can post a couple. \$\endgroup\$ Commented Jul 13, 2012 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
    Commented Jul 17, 2012 at 10:45
  • \$\begingroup\$ @GameCoder I just created an array to store the pixel values and looped over 'em to evaluate the function. \$\endgroup\$ Commented Jul 17, 2012 at 16:27
  • \$\begingroup\$ Might karlsims.com/papers/siggraph91.html be what you were thinking of? \$\endgroup\$
    – Anton
    Commented Jul 17, 2012 at 22:00
12
\$\begingroup\$

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

\$\endgroup\$
7
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\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\$ Commented Jul 17, 2012 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
    Commented Jul 17, 2012 at 22:53

Not the answer you're looking for? Browse other questions tagged .