Pseudocolor Filter for VirtualDub

This filter maps a video through a user-definable color palette. The luminance of each source pixel is calculated and then used to index the user-defined color palette to generate the output pixel. This filter would typically be used to pseudocolor a grayscale clip, but can also be used on color clips to generate interesting effects.

Several sample color palettes are provided. The user can easily generate her own palettes. Palette files are simple text files defining the RGB values of the palette entries (see below). The samples provided were taken from the public-domain package FractInt and are probably not optimal for pseudocoloring applications. The user is encouraged to develop her own palette optimized for the intended application. Users are encouraged to send me any palettes they create for inclusion in the sample package (I will credit your contributions).

Nina Cording has very kindly sent in a really cool utility for making palettes. Check it out!

Here is an example showing application of the supplied topo palette to a Landsat image:


Configuration Options

Palette File: This option specifies the palette to be used for the pseudocolor mapping. The selected file must have the format described below.

Palette File Format

Palette files must be text files with up to 1000 lines, with each line containing a palette entry (usually the file will have 256 entries). Each entry has the following form:

  red green blue

where red, green, and blue are integers in the range 0-255.

The first line in the file will correspond to palette index 0, the second to palette index 1, etc.

The luminance value of a source pixel, L, will be in the range 0-255 and will map to the user-defined palette as follows, where N is the number of lines in the palette file and P is the palette index that will be used to map the source pixel:

  P = (L * N) / 256

The supplied palette threshold shows an application using a palette with only two entries. Luminance values less than 128 are mapped to black and those equal to or above 128 are mapped to white.

Have a look at the supplied palette files if you find this explanation unclear.

Grayscale Ramp Video Clip

A grayscale ramp video clip is provided (grayramp.avi) to allow direct visualization of the selected palette. Simply load the clip and then apply this filter with the selected palette.

Version 1.0 [Source code]

Version 1.0 is the first released version.

[up to home page]