

Montage Options

The Anatomy Of A Montage

Montage Layout

A montage is a single image which is composed of thumbnail images layed out in a grid. The size of the montage image is determined by the size of the individual thumbnails and the number of rows and columns in the grid.

The following figure shows a montage consisting of three columns and two rows of thumbnails:

The Anatomy Of A Thumbnail

Un-Framed Thumbnails

Un-framed thumbnails consist of four components: the thumbnail image, the thumbnail border, an optional thumbnail shadow, and an optional thumbnail label area.

Framed Thumbnails

Framed thumbnails consist of four components: the thumbnail image, the thumbnail frame, the thumbnail border, an optional thumbnail shadow, and an optional thumbnail label area.

Montage Geometry

The montage geometry specifies the size in rows and columns of the generated thumbnail grid. Since a single montage is displayed per HTML page, after the montage grid is full, a new page is started. The montage geometry combined with the thumbnail geometry determines the total size of the montage image and therefore the size that the user's web browser must be set to in order to view the entire montage.

Setting the rows to a very large value (large enough that rows x columns exceeds the number of images) results in a single HTML page being generated. The user can then use the browser's vertical scroll bar to peruse the thumbnails.


--columns number

Specify the montage columns (max). This is the maximum number of thumbnail columns allowed per thumbnail row.


--rows number

Specify the montage rows (max). This is the maximum number of thumbnail rows allowed per page.

Montage Image Format

GIF/JPEG Transition Point

--maxgif number

Specify the maximum size of GIF imagemap before trying JPEG (default 30000). This is an optimization which tries to avoid the JPEG conversion step. When indexing true or deep-color images, JPEG usually leads to a smaller montage imagemap file.

Even if a JPEG image is generated, the smaller of the two images is selected for use and the larger one is deleted to save disk space.

Force GIF Format


Force GIF imagemaps to be generated (default off). This avoids the possible generation of JPEG format imagemaps when the GIF file is large (over 30K). The primary reason for using this option is because GIF supports image transparancy while JPEG does not, leading to a possibly more attractive display when using GIF format imagmaps. The drawbacks of forcing GIF format are larger imagemap files (often two or three times the size of JPEG when montaging true or deep-color images) and the limited color depth (256 colors) of the GIF format.

Montage Colors

Thumbnail Foreground Color

--thumbforeground colorspec

Specify the montage foreground color. This color is used as the color for thumbnail label text.

Thumbnail Background Color

--thumbbackground colorspec

Specifies the background color that thumbnails are imaged upon.

Thumbnail Transparent Color

--thumbtransparent colorspec

Specify a montage color to set transparent. Usually should be set the same as the background color $opt_colorback (see section Thumbnail Background Color) of the imagemap page. GIF format imagemaps use the transparent color directly while JPEG format imagemaps may approximate "transparency" by setting the imagemap background color to the same color used as the background for HTML pages. This approximation becomes less useful for clients with shallow colormaps.

Thumbnail Frame Color

--thumbframecolor colorspec

Specify the thumbnail frame color (only applicable if frames are enabled).

Thumbnail Frame Border Color

--thumbframebgcolor colorspec

Specifies the background color within the thumbnail frame. Ignored if there is no frame.

Quantize To Netscape Color Cube


Re-map the montage colors to the Netscape 216-color cube. Netscape maps colors to a fixed 216-color cube on PseudoColor color displays. Using this option allows you to ensure that Netscape doesn't dither or re-map your colors when used with common PseudoColor displays and the images may be smaller. The drawback to using this option is that the color quality will be significantly decreased on True and DirectColor displays or when using browsers that don't use the 216-color cube technique.

When using image transparency, make sure that the transparent color is selected from one of the 216 "standard" colors or transparency won't work.

Thumbnail Imaging

Enable Thumbnail Frame

--thumbframe geometry

Specify the geometry specification for frame to place around thumbnail. If no frame is desired then the string "false" should be specified. The specified geometry values are in addition to the thumbnail geometry. For example, a frame geometry of '8x8' places an 8 pixel frame around the image.

Enable Thumbnail Shadows

--thumbshadow boolean

Set to string "true" or "false" to control the use of decorative shadows around image thumbnails (or frames if enabled). The default is "false".

Thumbnail Frame Border Width


Specify the border (in pixels) to place between a thumbnail and its surrounding frame. This option only takes effect if thumbnail frames are enabled and the thumbnail geometry specification doesn't also specify the thumbnail border width.

Thumbnail Background Texture

--thumbtexture texturespec

Specify a texture to use as montage background. The built-in textures "granite:" and "plasma:" are available. A texture is the same aas a background image. For example:

Granite texture:


Plasma texture:


Image file texture:


Thumbnail Geometry

--thumbgeometry geometry

Specify image thumbnail geometry. Thumbnail geometry is specifed in the form:


Specify the size and scaling options for thumbnail images (default '106x80+2+2>').

The following description is extracted verbatim from the montage manual page regarding the treatment of this option:

By default, the width and height are maximum values. That is, the image is expanded or contracted to fit the width and height value while maintaining the aspect ratio of the image. Append an exclamation point to the geometry to force the image size to exactly the size you specify. For example, if you specify 640x480! the image width is set to 640 pixels and height to 480. If only one factor is specified, both the width and height assume the value. Use > to change the dimensions of the image only if its size exceeds the geometry specification. Use < to resize the image only if its dimensions is less than the geometry specification. For example, if you specify 640x480> and the image size is 512x512, the image size does not change. However, if the image is 1024x1024, it is resized to 640x480. Each image is surrounded by a border whose size in pixels is specified as <border width> and <border height> and whose color is the background color.

Thumbnail Gravity

--thumbgravity direction

Specify the thumbnail positioning within the specified geometry ($opt_thumbgeometry area. If the thumbnail is smaller in any dimension than the geometry, then it will be placed according to this specification. Available options are NorthWest, North, NorthEast, West, Center, East SouthWest, South, and SouthEast. Just as with a map (at least those in the northern hemisphere) North is up and West is left. The default is Center so that thumbnails are centered in their grid.

Thumbnail Composition Algorithm

--thumbcompose operation

Specify the image composition algorithm for thumbnails. This controls the algorithm by which the thumbnail image is placed on the background. Available options are (default Replace): Over, In, Out, Atop, Xor, Plus, Minus, Add, Subtract, Difference, Bumpmap, Replace, MatteReplace, Mask, Blend, and Displace. Use of Over is recommended for use with images that have transparency. This option may have negative side-effects for images without transparency.

Thumbnail Zoom Filter

--zoomfilter filtertype

Select the filter algorithm to use for image zooms (reductions & enlargements). The available values are Box, Triangle, and Mitchell. The algorithms have a significant effect on processing time and may have a perceptible effect on image quality. Images zoomed via the Box algorithm will have the lowest quality (unsuitable for further processing) and will zoom the fastest. Images zoomed via the Triangle algorithm usually have sufficient quality that it takes careful inspection to detect differences from the best algorithm.

The Triangle algorithm is almost as fast as the Box algorithm so there is little need to use the Box algorithm. The Mitchell algorithm produces the best possible results (preserving fine details) but with a 40% (or so) speed penalty overall as compared with the Triangle algorithm. If speed is not important for your application, and end-users are likely to be using deep-color displays, then by all means choose the Mitchell algorithm because if you choose a lesser agorithm, you will never know what you are missing.

Thumbnail Label Options

Thumbnail Labels

--imgindexname filename

Specify the filename for the image name to thumbnail-title cross-reference for images (default `.imgindex'). If this file exists, then labelformat will replace imagename if imagename is found in the file. This provides the ability to use user-specified label text rather than the default provided by $opt_thumblabel. See the description of $opt_thumblabel or the montage(1) manual page for information on the label format. The order specified by this file is used to sort image names. If an entry for an image is not in this file, then that image name is sorted alphbetically with relation to the other image names.

The format of the image index file consists of an image name followed by an image label. The image name and the image label are delimited by white space which may be one or more space or tab characters as shown in the following example:

mr2-91ev.jpg	'91 Front
mr2-91re.jpg	'91 Back
mr2-91si.jpg	'91 Side

Thumbnail Label Format

--thumblabel format

Specifies the default format of thumbnail labels. The image filename, type, width, height, or scene number in the label by embedding special format characters. Embed %f for filename, %d for directory, %e for filename extention, %t for top of filename, %m for magick, %w for width, %h for height, %s for scene number, %b for file size, or \n for newline. For example,

    -label "%m:%f %wx%h"

produces an image label of MIFF:bird.miff 512x480 for an image titled bird.miff and whose width is 512 and height is 480. (This explanation borrowed from montage manual page). If a label is not desired, then use the argument "label" to turn off this feature.

The default format is '%f\n%wx%h %b' which displays the filename over the image geometry followed by image size.

See the $opt_imgindexname option for a description of a more powerful per-image labeling mechanism.

When $opt_cache is enabled, a number of labeling features will not work correctly since they may refer to characteristics of the cached thumbnail rather than the original image.

The labels which are supported when caching is enabled are:

(file size)
(full filename)
(filename minus extension)

Thumbnail Label Width

--thumblabelwidth labelwidth

Specify the maximum column width (in characters) of label text. Label text longer than this is truncated to the specified width. The purpose of this is to ensure that the label is not munged due to excessive length.

Thumbnail Label Font

--thumbfont fontspec

Specify the thumbnail title font. This is the X11 font used to title thumbnails (default 5x8). PERL's newgetopt module seems to have difficulties with the dashes in most X11 font specifications. If 'getopt' prints the usage message rather than doing what you want to, then try using the command line syntax --thumbfont=fontspec and you should have better luck.

Thumbnail Processing Hooks

WebMagick provides EMACS-like hooks that can be used to insert additional processing code fragments into the thumbnail generation code.

Read Failure Hook


PERL code fragment to evaluate if an original image fails to read during the process of building a thumbnail. Usually this is due to the original image being corrupted. Your mileage may vary.

When the code fragment is executed, the name of the current image is in the variable '$imagename'. For example:


removes the image, assuming that it is defective. In the case of images retrieved from the binaries newsgroups this is not a bad assumption.

Thumbnail Post-processing Hook


PERL code fragment to evaluate on the reduced thumbnail before saving it to cache or using it in the montage. The thumbnail image is available via the variable $image. For example:

   warn $status if "$status"';

applies the PerlMagick Sharpen operation on the thumbnail,

   warn $status if "$status"';

displays thumbnails in grayscale, and

   warn $status if "$status";
   warn $status if "$status"';

displays embossed thumbnails.

See the PerlMagick documentation for the many other operations which may be applied to an image.

Thumbnail Pre-Processing Hook


PERL code fragment to evaluate on the original image in memory prior to reducing it into a thumbnail. The image is available via the variable $image. For example:

 warn $status if "$status"';

applies the PerlMagick Blur operation on the image. See the PerlMagick documentation for the many operations which may be applied to an image.


SourceForge Logo

Last modified: Saturday September 21, 2002