Maze - a plug-in to draw mazes for the GIMP.


Fills the active selection or layer with a maze. Every square in the maze is accessable from every other, if you can find the right path. There are no loops (well, see Bugs). Features include a choice of maze generation algorithms (Prim's Algorithm or depth-first), tileable mazes, and non-rectangular shaped mazes.


Width & Height

Changes the width/height of the wall and passage blocks (currently there is no support for making the two different sizes). The "pieces" selectors are provided as semi-intelligent aides to choosing a proper size, taking into account the tileable mode and image size. They will only chose sizes that divide more or less evenly into the image size, an even or odd number of times, depending on wether the maze is to be tileable or not. However, in the end, it's the width and height settings which are used to produce the maze, so results may not exactly match the "pieces" setting if you did something weird to it.


The maze plug-in can generate tileable mazes; that is, make passages going off the right (or bottom) edge wrap around and be continued on the left (or top). This is useful for wallpapering and the like.

This places some constraints on the passage size. There must be an even number of divisions, and the passage size should divide evenly into the image size. Note that non-tileable mazes have an odd number of divisions. Maze silently enforces this rule.


The random seed used to generate the maze. Use the same seed with the same maze size and wall width, and you'll end up with the same maze. Pressing the "Time" button will use the current time as the random seed.


The plug-in knows two different ways to make mazes; the depth-first method and Prim's algorithm. Depth-first is much faster than Prim's algorithm, and generally produces long, twisty passages, while Prim's algorithm is typically characterized by many very short passages with frequent branches. A description of the different techniques can be found in the Maze FAQ.

Shaped mazes

If there is an active selection, maze will keep non-selected portions of the layer as wall and create maze passages within the selection. If the selection is disjoint, the plug-in will draw as many mazes as needed to fill all portions of the selection.


The plug-in checks this file for GTK preferences.


>PDB Declaration

Name PDB Type C Type Notes
run_mode INT32 GRunModeType  
image_ID IMAGE gint32 unused
drawable_IDDRAWABLE gint32  
width INT32 guint Size of cells, walls, and passages, in pixels.
height INT32 guint
tileable INT8 gbooleanTileable maze?
algorithm INT8 MazeAlgoType0=Depth First, 1=Prim's Algorithm
seed INT32 guintRandom seed
multiple INT32 gintUsed by the RNG, 57 works
offset INT32 gint1 works


>See Also

Last modified: 2000/04/18 00:20:33
Maintained by Kevin Turner