In 8-bit/pixel modes, each pixel value is translated through a ``colormap'', a look-up table which you can easily modify in tnimage. The new table is saved along with the image (for TIF, BMP, and TGA files) so the next time you load the image, the display changes to the modified colormap. Changing the colormap has two advantages over other methods of changing brightness or color: (1) it is much faster, and (2) it is always reversible since it never affects the original image data. The disadvantages are that changing the colormap only works in indexed color screen modes, and it always changes the entire screen. If you need to brighten just a portion of the screen, use the ``color intensity/brightness'' menu option.
In color modes, the current colormap table is used as a guide to determine how an monochrome image is converted to color when it is loaded from disk, but does not otherwise affect the display.
It is usually convenient to select ``Show colormap'' while selecting a false-color palette, as the colormap display is updated as soon as the palette has changed. (Be sure to click on an 8-bit image before doing this, so the colormap display shows the 8-bit colormap and not the true-color `colormap').
Invert colormap
Switches the colormap so that all images become a negative. Changes the appearance only, and has no effect on the actual pixel values in the image.
Select colormap
You can select from a variety of different color colormaps. Changing the colormap has no effect on the image when it is stored or densitometrically analyzed. However, it can be used to enhance the visibility of details in the image. Each image can have a different colormap.
The following pre-set colormaps are available:
Gray scale - continuous shading of 256 levels of gray.
Multi-color 1 - a continuous blend of colors useful for enhancing low-contrast images.
Multi-color 2 - a discontinuous sequence of short color gradients
Multi-color 3 - a discontinuous sequence of color gradients arranged oppositely from multi-color 2.
RGBI - 4 continuous gradients, 0-63 = red, 64-127 = green, 128-192 = blue and 193-255 = gray scale.
Spectrum - A single continuous gradient from blue through the colors of the spectrum to red and then white.
Black to green - Same as gray scale except black to green instead of black to white.
Zebra - Alternating black and white - useful for finding very subtle patterns in the image. Creates a contour-line effect.
Brightness - Lightens or darkens colormap, increasing or decreasing color saturation.
Other - User-selected colormap. Select the desired number with the mouse to select from a wide range of different computer-generated colormaps.
1-100 Various gray scales
101-1000 randomly-generated gradients. The amount of color gradually increases in intervals of 100.
1000-10000 continuous, smooth gradients without sharp breaks in the colors. The number of light and dark cycles varies from 1 upwards. Some are a single color, others are gray scales, and others are multiple colors.
Example: 2345 = shades of `gold'
Read colormap
Reads a colormap file from disk. Colormap files are ASCII text files which can be created with a text editor, or created graphically within tnimage (see Create colormap ).
If you create a colormap file manually, your colormap file should consist of 4 columns of up to 256 rows. The first column is the color number or `index', an integer between 0 and 255, indicating which color. The other 3 columns are integers between 0 and 63, which define the amount of red, green, and blue respectively for each color. For example:
0 0 0 63
1 63 63 63
255 7 7 7
This file would set color 0 to light blue, color 1 to bright
white, and color 255 to dark gray. All other colors would be
unchanged (Normally, a colormap file would have 256 rows
instead of only 3).
Save colormap
Saves the current colormap into a disk file.
Create colormap
Graphically creates a custom colormap. There are 3 boxes, one for red, green, and blue, which graphically represent the intensities of each color in the colormap. To change the colormap, click on the graph corresponding to the desired color and trace out the desired new graph while holding the left mouse button down. The graph and colormap will both adjust in real time to reflect the new values.
Clicking `smooth' smoothes out the newly-drawn curve to create a more even dispersal of colors in the colormap.
Rotate colormap
Rotates the colormap table through all 255 colors. This effectively increases the number of predefined colormaps to 2.5 million. Useful in achieving fine control of the appearance of the image and enhancing subtle details.
If you find a number that gives a useful effect, write the number down for future reference or save it using ``Save colormap''. The actual pattern of colors in the colormap is not easily predictable from the color number. (Saving the currently-displayed screen or a portion of it as a TIFF or PCX file, or selecting `Save colormap' will also save the colormap.)
Restore original colormap
Restores the colormap the image had when it was originally loaded from disk. Useful when you accidentally rotate the colormap of a GIF file.
Sort colormap
Sorts the colormap from lowest to highest luminosity and remaps the image accordingly. This is often an essential step before performing densitometry on an image, or before setting chromakey for an image, as these functions rely on a correspondence between the raw pixel value and intensity.
Remap to other colormap
Sets each color in the currently-selected image, equal to the closest color in a second user-specified image, and then copies the other image's colormap. This permits creating two 8-bit images that have the same colormap. This is useful in creating images for Web pages, where it is desirable to use a minimum number of separate colors. If someone is viewing your Web page with an 8-bit display, a large number of images with different colormaps can result in poor overall quality because the browser will run out of colors.
False color map for grayscale
Grayscale images can be displayed in false colors instead of shades of gray by setting the ``false color'' map. This allows a large range of gradations to be distinguished at the same time, or a narrow range to be highlighted. The colormaps numbered 0-199 are particularly useful for this, as they contain several repeated grayscale gradients.
The false-color map is global and not attached to the image. This has several implications:
(To attach a colormap to an image, the image would have to be converted to ``indexed-color'' or ``color'' first.)
Remember that a false-color image is, despite appearances, still a grayscale image as far as the computer is concerned. Thus, selecting ``invert colors'' will merely invert the false color map, instead of changing red to green, yellow to blue, etc. To change the false-color mapping, you must still select ``Grayscale mapping'', in the same manner as a regular grayscale image; dragging the palette bar, selecting ``Color/contrast'', or other operations that act on color images will not work.
Note: If for some reason the image does not get redrawn properly after changing the false-color map, try pressing Alt-R to repair the image.
Reset grayscale to default
Sets the false-color map back to its default setting, i.e. a continuous gradient from black to white.