Skip to content
rndmcnlly edited this page Sep 13, 2010 · 6 revisions

Downloading

Search for “iteration” in the Android Market.

Usage

Basics

  • Open the app.
  • Observe your first image being generated (each one is unique, though there are common patterns).
  • Click the trackball, d-pad center, or camera button to start generating a new image.
  • Press menu to access image saving and preferences.

Recipes

Creating a nice wallpaper image.

  • Set the “Canvas scale factor” in the preferences menu to 150% or 200%. The higher the resolution you select the longer it will take to accumulate detail, so be patient.
  • Watch new images being generated. The results will look very similar to those at the standard resolution, however they will more detail when you zoom into the saved version.
  • Ready yourself to hit the “Save to gallery” button in the menu when you see an image you like.
  • After hitting save you will be taken to your preferred image viewer app where you can crop it and set it as your device’s wallpaper (or email to use as wallpaper on desktop computer or a friend’s device).

Endless slideshow

  • Select “Reconfigure Self” from the preferences menu.

FAQ

Q: How can I influence the images?

  • Beyond the collection of options in the preferences menu you cannot influence the generation process. The existing options were picked as a balance between artist control and audience control. Maybe a future project (beyond Iteration) will explore the kind of interaction you are interested in. Email me with your ideas.

Q: Why does a high canvas scale factor crash on some newer devices?

  • The android framework allows applications to use only up to 16MB of heap space. The the 32-bit-per-channel color buffers used in Iteration take up a lot of space, and for devices with a high screen resolution a higher resolution canvas may exceed this limit. Did you really need that extra resolution? I use integer approximations all of the place in the code to improve performance, so at some zoom level that smooth detail will be replaced by quantization grit anyway.

Artist’s Notes

Inspirations

Design

Composition

Images in Iteration are composed using an iterated function system. Specifically, Iteration uses a system of two functions which take the form of a scale, non-linear wrapping using sine and cosine functions, and a post-rotate. Each time the system is reconfigured, four new random values are selected for parameters to the scale part of the functions.

High-depth Color Buffer

In order to generate very smooth gradients, Iteration composites a very larger number of very faint points onto the canvas. In order for these very faint points not to be lost in the pixel-blending process, a custom software color buffer is used that uses 32 bits per channel to form a fixed-point color buffer. As pixels are accumulated (using additive blending) into this fancy buffer, another buffer using only 8 bits per channel is updated. This second buffer is used for the live display and saved images.

Native Arithmetic

Running on a small, battery powered processor, Iteration is careful to make use of all available computing resources on your mobile device. The core logic of the iterated function system and color compositing takes place in native code, described in C. Because most Android devices lack an FPU, this highly optimized code uses a lookup-table to calculate the sine and cosine functions in the context of an integer-only implementation. The final native solution is able to place points over 100 time faster than the obvious Java implementation using emulated floats.

Accelerated Display

The native logic in Iteration produces a screen-sized image from scratch. In getting this image onto the screen there were many options. The fastest (and, incidentally, most pleasing) of these was to upload the image as a texture in OpenGL every frame and draw it over two triangles. Exploiting the GPU, a soft twirl-in animation could be added without a noticeable performance hit.

History.

1.x

  • Initial attempts at porting a minimal Processing-like library to Android
  • The earliest versions of Iteration were a direct-as-possible translation of this Processing sketch: http://adamsmith.as/typ0/k/fancybuf/
  • Rendering used Canvas#drawRect
  • An iPhone port was created using the algorithm behind this version

2.x

  • Switched to software-rendering using Canvas#drawBitmap for final display
  • Experimented with cubic approximation to sine/cosine
  • Introduced parameter-sweep rendering

3.x

  • Switched to native, integer-only computation
  • Switched to OpenGL texture upload for final display