++ed by:

4 PAUSE users
2 non-PAUSE users.

Marc A. Lehmann


image_tile - An image tiling plug-in for The Gimp


image_tile is called from The Gimp under the Perl-Fu image menu.


image_tile is a plug-in for The Gimp that re-creates an image by tiling many sub-images which are in turn chosen for their likeness to a part of the original.

In other words, you give image_tile a base image (the one you open in The Gimp, and call image_tile on) and a list of directories to find other images in. It then tiles small versions of the images over the original image in such a way that you can still make out the original if you squint hard enough.


image_tile requires a large number of image to work from. This is because it needs to divide up your original image and for each tile, find another image which looks like that tile. This can require anywhere from 2000 to tens of thousands of component images.

image_tile will use as much disk space as is required to store the sampling information that it creates for each of the sub images. However, its use of memory is much more conservative. The assumption being that a lot more people have a Gig of disk free than a Gig of RAM. So, expect a large file to be created in your .gimp directory (you can select automatic cleanup of this file if you wish).


When you bring up the image tiler, you are given several options. Each of these is detailed below:

Number of tiles

The number of tiles in the X and Y directions must be given. This is the number of sub-images that will be tiled across and down your original image.

Number of cells

In each tile, the image tiler will sample color areas to determine a match. The more color areas you sample, the more accurate the match, but this also increases memory, disk and time usage. The default of 4 cells in each direction is good for most tiling which is meant to be viewed on-line. Print-quality tiling will have to use more samples to get even finer details right.

Duplicate weight

This is a number from 0 to 100 (actually, there is no real upper bound, but 100 is a practical upper limit). This is a weight applied to each sub-image each time it has been selected. Thus, if you use a hight weight, images will tend to be chosen only once. If you use a low weight, images will be chosen as many times as they happen to be the best fit. A weight of 0 will lead to the most accurate match, but due to the repetition of some images, you may find the resulting image to be difficult to make out.

Sub-Image directories

This is a space-separated list of the directories in which The Gimp will be able to load sub-images. You may use csh-style file "globing" such as /tmp/images/image_dir_* or /mnt/cdrom/images_[1234].

Delete cached image samples

This toggle button will tell the image tiler whether or not to delete the cached image samples that it creates while reading the sub-images. If you are planning to attempt matching these sub-images against this base image again (say, adding a few new files, or brightening the base image first), you will probably want to keep them around, as the time savings is huge. However, since these samples are based on aspect ratio and number of cells, you cannot re-use the samples if you change the number of tiles or number of cells. Sorry.


Written in 1998 (c) by Aaron Sherman <ajs@ajs.com>


Most of the bugs in the image tiler are actually just design limitations. For example:

  • The images must all be the same aspect ratio, so image_tile will crop them to match the target aspect ratio. Because of the large number of images involved, it is impractical to specify a crop area for each one, so the center of the image is chosen.

  • If The Gimp library were multi-threaded the image tiler would read more than one sub-image at a time.

  • Directory selection is crude. Gimp needs a file/directory selection model for plug-ins similar to the color selection model.

  • If some of your sub-images are bad, the image tiler will display an error message when trying to load them. This can result in a lot of messages for a multi-thousand image database.

  • URLs should be handled as image directories.

  • Some text describing what image directory is being searched would be nice, but this would require more code than I want to write right now.


gimp, perl, Gimp: the Gimp module for perl.