next up previous contents index
Next: Invert colors Up: Color menu Previous: Grayscale intensity mapping   Contents   Index

Remap colors

Changes the colors in an image by substituting from a map file. It acts differently on indexed color and color images.


8-bit/pixel images:


Changes the pixels in the image or screen region by substituting from a set of values specified in an ASCII file. This file should consist of a list of 2 columns of numbers. The 1st column is the pixel value to change, the 2nd column should be the desired new values. For example:

            1         255
            2         200
            3         180
            4         175
          255           0


This file would change all pixels with a value of 1 to pixels with a value of 255, those with values of 2 to 200, 3 to 180, 4 to 175, and 255 to 0. Any other pixels would be unaffected. Typically in a remap file, you would remap all 255 colors, but this is not essential. Be sure colors 0 and 255 do not accidentally get remapped to the same value, otherwise it will be impossible to use the menus (this applies only to DOS version).

The most common use of this is to reduce the number of separate intensity values in an image, by eliminating those values in regions that are not of interest. This can greatly improve the compressibility of an image.

Another use is to stretch the contrast. Since the new intensity values can be known in advance, contrast enhancement can be done on multiple images in an exactly reproducible manner.

The Macro Editor can be used to create remap files without leaving tnimage .


Color images:

Interchanges r,g, and b color values. This could be used, for example, to convert an image to a single color or to correct for color errors in a corrupted image file.


next up previous contents index
Next: Invert colors Up: Color menu Previous: Grayscale intensity mapping   Contents   Index
root 2006-11-13