Gray Scale Mosaic by Jim Buzbee

Gray Scale Mosaic



Example Images

Comments or Questions

My Other Pages:

I've got the only Internet Accessible Bat House in the world

I found a security hole in Java

Here's my example of a Hostile Java Mail Applet

Here's my Hershey Font page.

Here's my Spiral Font page.

Here's my Tumblin` Text page.

A low resolution image of the woman from Edward Hopper's Nighthawks mosaic'ed with itself.


This program was inspired by the work of Robert Silvers who pionerred the idea of creating an image made up of a "mosaic" of other images. Gmosaic is a more simplistic program that will create a gray scale mosaic of an input image using either a specified image "tile" or a tile created from the input image itself. Each tile in the output image has its overall intensity adjusted to match the intensity of the corresponding pixel in the input image.

At this time, the only format image that can be used is PGM in either raw or ASCII format. The output image will be in raw PGM format, unless a compile-time flag is set for ASCII. Gmosaic can generate a image tile from the input image, but for best results a tile should be "hand-crafted" either from the input image or from another image.

Take caution when creating an image as it is very easy to accidently generate a huge output image. For example, trying to use an input image of 640x480 with a tile of 64x64 will result in Gmosaic attempting to create an image of size 640*64x480*64, e.g. a 40960x30720 image which would likely exhaust the memory of the system.


Copyright (C) 1999 Jim Buzbee ( )
Gmosaic is released under the terms of the GNU General Public License


Gmosaic [-a value] [-t tile] [-s size] [-o file] [-d] [-h] [file] Options : -a value : Adjust the output intensity by this factor, i.e. 1.2, 0.5 etc. -d : Debug. If this flag is specified, some debug type messages will be written to stderr. -h : Generate usage statement -o file : Output file. The file will be written in PGM format. If the output file is not specified the image will be written to standard out. -s size : Size of the tile to be used when Gmosaic generates a tile from the input image. The value specifies the width of the tile and should be a small number such as 20 or 22. -t tile : A PGM format tile image that will be used to compose the output image. This should be a fairly small image, i.e. 24x24, 15x15 etc. and should be "square" or else the output image will have an incorrect aspect ratio. File : Input file. The only supported input file format is PGM in either raw or ASCII format. If the input file is not specified, the image will be read from standard input.

To Do

Support for more image formats
Perhaps support for use as a screen saver
Perhaps support for using multiple tiles

Gmosaic, by Jim Buzbee