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:
- Start with a blank (grey, actually) image. This is the "working"
image.
- 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.
- Calculate the placement of each image on each layer.
- In TV mode, decide (50% probability) whether to change channels,
or leave the tuner on its current settings.
- Decide (50% probability) to rotate images freely, or only on 90
degree intervals.
- One of:
- Iterate through each layer, and within each layer,
iterate through each tile, or
- Iterate through layers and tiles in random order.
- At each iteration:
- 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.
- In web mode, acquire an image from one of the given
URLs at random.
- In TV mode, switch channels if we are changing channels,
then acquire one image.
- Scale the image to the current tile size.
- Rotate the image to a random angle.
- Superimpose a fractal plasma on the rotated image's matte layer.
- Superimpose the rotated plasmafied image onto the current image tile.
- Repeat all of the above.
- Select a random post-processing effect (e.g. gaussian blurring,
convert to monochrome, edge detect, etc), and apply to the working
image.
- Crop the centre 25% of the image.
- 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:
- High-frequency monotonal noise: all images captured from
cable have a monotonic signal at the rate of about 1.5MHz
superimposed on them, which looks like closely spaced diagonal
or vertical lines across the image. This noise artifact appears
to be part of the local cable TV service.
- Reflection noise: a series of three or four irregularly
spaced vertical bars of low-amplitude noise spread across the
image. This noise artifact appears to be due to poor shielding
within the TV tuner hardware.
- Interlacing: The video capture software captures 640x480
"frames" representing a sampling rate of approximately 30Hz,
while the reality of NTSC is that such "frames" actually consist
of two interleaved 640x240 "fields", each of which represents a
sampling interval of approximately 60 Hz, where each consecutive
frame samples the input image at a vertical displacement of plus
or minus one half of the vertical resolution of the output image
relative to the previous output image. If the input signal is
mostly static (i.e. no movement) or if it originated from film
(which has a frame signal change rate of 24 Hz) then there is
no practical difference between two interleaved "fields" and one
"frame", and the 640x480 image has a higher effective resolution
than the two 640x240 fields combined to form it. Unfortunately,
under other conditions (e.g. a video camera using physically
moving objects as an image source instead of non-moving film
frames), the notion of a frame being the combination of two
consecutive fields is simply wrong. This artifact appears as
a series of horizontal lines closely spaced in the vertical
direction which are sampled from two distinct images.
- "plasma": After all input TV images are combined, the
final combined image is overlaid on top of a fractal "plasma"
image to create the output image. Any transparent areas of
the final combined image are therefore replaced with "plasma."
This is intentionally added because a common degenerate case is
an entirely transparent or entirely black image, and many images
have transparent or black edges or corners. I don't like this
particular feature in an image I use as desktop wallpaper--it
prevents me from knowing where the boundaries of the screen
are--so I forcibly add in a little bit of texture to each image
so there can never be a truly flat blank image.
- JPEG artifacts: JPEG adds edges to the image on 8x8 pixel
boundaries in Y space and 16x16 pixel boundaries in UV space,
due to various losses incurred during image quantization.
- Common degenerate cases: The most common degenerate case
is an image that is almost entirely extreme in the pixel values
of one of its channels (red, green, blue, and alpha). Some of
the image combination operations affect only single channels,
so images are often dominated by primary colors, white, and
black.
- The Composite imput: if there's nothing being played,
recorded, or watched via my VCR, and the Composite input of the
capture card is selected, all input images will be a uniform
blue rectangle.
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:
- Some good images come out of MTV-like stations ("MuchMusic" for
English-speaking Canada, "MusiquePlus" for French-speaking Canada).
These channels contain a variety of very "artistic" images, and the
superimposed titles lend the images some text. However, while a few
images from MTV-like stations are well above average, the vast majority
suck. The same seems to be true for the unmodified content, actually...
- Specialty cable channels provide good thematically-related images.
The weather channel produces many images with icons and text data in them
that produces abstract art with a weather-related or geography-related
theme. The Shopping channel is good for this kind of image too, but
they don't provide signal for significant portions of the day.
- Surprisingly, the TV Guide channel (with TV listings on the left
and advertising on the right half of the screen, as well as prominently
featured date and time stamps) often produces quite appealing abstract
art with a pop culture theme.
- Dedicated news channels such as CNN provide abstract art with a
current-events theme, sometimes with threads of political advocacy,
although what it's advocating usually makes no sense at all.
- Cartoons provide good high-contrast images with lots of edges.
- The sci-fi channel ("Space" in Canada) produces images that geeks
could love.
- Anything with subtitles or open captioning lends the images a
slogan that people familiar with the "dissociated press" would
recognize.
- Test patterns and completely static text images (such as the "this
station is not broadcasting at this time" message issued by my cable
company) generate mathematical-lookinga abstract art with variety of
textures, as the noise in the video signal is combined with itself.
- Images from scrambled pay-TV channels can make interesting abstract
art without any modification at all.
- Local TV stations, with general interest drama or sitcom programming,
generally produce mediocre images, except when they are broadcasting
commercials. Go figure.
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.