The (new) TV Mosaic

TV Mosaic is similar to the TV Blender, described below, except that it uses fewer image combination operators. The results look a little more visually pleasing. Just a little. It also uncovers fewer bugs in ImageMagick, although the few bugs that it does still uncover can really ruin your image processing day. :-/

TV Mosaic is capable of dealing with randomly generated images of all kinds; simply replace the "streamer" command with, say, wget pointed at a webcam, or a random-image-URL from some search engine, and you can use non-TV images. In fact, a method for fetching images from a set of URLs and a method for fetching images from an X desktop is already provided.

Another difference is that TV Mosaic does not produce an image on stdout; instead, it produces an image named "out.jpg" in the current directory:

$ tv-mosaic | sh; display out.jpg
Still another difference is that TV Mosaic is written in Tcl, so there is a TV Mosaic Tcl Script. I'd recommend Tcl 8.2 or 8.3, although it might work on earlier versions.

Images are captured as the image processing is able to handle them. There are now more than 30 images, and they range in spacing from 1 to 60 seconds.

The complete process:

  1. Start with a blank (grey, actually) image. This is the "working" image.
  2. Divide the image into layers, where each layer is divided into a geometrically increasing number of tiles. Stop division when the number of tiles exceeds a maximum.
  3. Calculate the placement of each image on each layer.
  4. In TV mode, decide (50% probability) whether to change channels, or leave the tuner on its current settings.
  5. Decide (50% probability) to rotate images freely, or only on 90 degree intervals.
  6. One of:
    1. Iterate through each layer, and within each layer, iterate through each tile, or
    2. Iterate through layers and tiles in random order.
  7. At each iteration:
    1. In desktop mode, capture a random region of the desktop with the same aspect ratio as the working image. Assume that the desktop and the working image are the same size.
    2. In web mode, acquire an image from one of the given URLs at random.
    3. In TV mode, switch channels if we are changing channels, then acquire one image.
  8. Scale the image to the current tile size.
  9. Rotate the image to a random angle.
  10. Superimpose a fractal plasma on the rotated image's matte layer.
  11. Superimpose the rotated plasmafied image onto the current image tile.
  12. Repeat all of the above.
  13. Select a random post-processing effect (e.g. gaussian blurring, convert to monochrome, edge detect, etc), and apply to the working image.
  14. Crop the centre 25% of the image.
  15. Convert to JPEG.

The (old) TV Blender

The TV Blender is a random image generation program by Zygo Blaxell.

TV Blender captures images over a period of 30 seconds to two minutes from a random TV station, adds an alpha channel, filters them through random effect filters, transforms them through random shearing, rotation, scaling, and displacement vectors and then combines all of the images together into a single image using random image combination operators.

The Software

The TV Blender Perl script. The perl script generates a shell script which produces a JPEG file on stdout. You use it something like this:
$ tv-blender | sh > output.jpg
You will need the streamer and imagemagick packages for this program to work under Debian GNU/Linux.

The Images

The images are available on a separate, automatically updated page. New images appear at the top of the page. Clicking on an image extends the amount of time that it remains on this page.

The opinions expressed (if any) and the content of the images (if any) are those of whatever randomly-selected cable TV signal was used as input data. Viewer discretion is advised, in case any nudity, scenes of violence, or other mature or objectionable subject matter was captured and survived all the image mangling. It is also possible that offensive subject matter could be created by combining two or more otherwise inoffensive images.

The default image size is 900x720 pixels, which is 1/4 of the size of my desktop (and more than 16 times faster to generate than 1800x1440 images ;-)). They range in file size from 200K to 1500K.

New images are generated 24 times per day, approximately once per hour. The exact time varies in order to avoid biasing the input data. It would be bad if we captured the same station identification images at the beginning of each hour, for example...

Other Notes

The result sometimes looks like an aggressive kind of modern art. Sometimes it looks like a rectangle full of random pixels. Sometimes it looks like a rectangle full of pixels of constant color. Sometimes it looks like the cable TV feed is unplugged. Sometimes it looks like an infomercial.

A few major image features are a result of the image capture and generation system. These are:

The most recognizable shapes in the combined images are usually logos, brand names, or information that is part of images used in advertising on commercial TV stations. You can often figure out which station was used as input data because no matter how badly mangled the images are, the "watermark" logo that TV networks love to superimpose over the bottom-right of each input image survives just about any image modification operation except for translation operations that push the logo outside of the frame entirely. In fact, the tendency seems to be for many image operations to emphasize the logo, not obscure it. Go figure.

The quality--artistic or otherwise--of the images is as random as the algorithms used to generate them and the images that were broadcast on whatever TV station was selected. The principle of "garbage in, garbage out" applies.

Some notes about input TV stations:

The images are captured using a Bt878-based video capture board (an Hauppauge 401 card to be precise) running under Debian GNU/Linux. The set of random image operations used is a subset of those supported by ImageMagick, although I try to support as many as possible. The randomness in selecting image operations is biased according to my personal opinion of their effectiveness in creating good output images.

The input data for each output image consists of 30 frames captured approximately 1 second apart. All input frames used to create a single output image come from the same TV station, but different TV stations are used for different output images. This gives the images a certain amount of variety while at the same time assuring reasonable thematic interrelationships between the images.