Palette Colourmap Editor

Quick Contents
VLAB Home

Overview

Palette, VLAB's Colourmap Editor, is an interactive utility for manipulating colourmaps. It works with 4096 entries treated as 16 pages, each page with 256 colours and each page represented as its own 768-byte file. This utility is useful in conjunction with programs that operate in colour space, but do not set up the colourmap themselves (for example, CPFG and Panel Manager).

Palette Execution

Execute Palette using the following arguments in an object's specification file or at the command line:

> palette
Opens Palette with 16 new colourmap pages for editing, with greyscale in the first page.

> palette -m[pg#] [filename] ...
Opens specified colourmap file(s) on specified pages.

> palette ... -w [width] [height]
Opens Palette with specified dimensions.

Note: The only way to load a specific colourmap is via command line arguments, and each page has its own file.

A colourmap file is always exactly 768 bytes in length, 256 entries of 1 byte each red, green and blue.

Menu, Display and Selection

Palette is capable of editing up to 16 pages. A colour entry is represented as a coloured square. Each page contains 256 colour entries, arranged as 16 columns and 16 rows, index 0 in the upper left corner with indices increasing downwards.

The popup menu, shown in figure 2 below, is activated by pressing the right mouse button anywhere on the colourmap entries.

Figure 1 - A sample palette screen.

Figure 2 - The palette popup menu and keyboard shortcuts.

Page numbers along the top of the window (1 to 16) indicate the 16 colourmap pages. Some of the pages may be blank (all black entries). A page is made current by selecting the radio button to the left of the number with the left mouse button. Since each page has its own file, its name is displayed in the title bar. In figure 1 above, page number 1 is the current page and the filename is lychnis.map.

A single colour index is selected by clicking the left mouse button on the coloured square, or by entering the index in the spinbox in the lower right corner.

A range of indices can be selected by clicking the left mouse on the lesser index, and dragging to the greater index. In figure 1, indices 98 to 102 are selected.

An entire page can be selected by activating the popup menu and selecting Select All.

Selected indices are outlined in a light colour. Unselected indices are outlined in black, except for very dark colours which are outlined in a dark grey.

The 3 RGB sliders located above the colourmap entries and below the page selectors display the RGB values of the selected colour. In figure 1 above, the sliders display the colour of index 98. The color may be changed by manipulating the sliders using the left mouse to select and slide to the desired RGB levels, left to decrease and right to increase.

Note: Slider manipulation will only affect a single index, or on the first index in a range.

Actions on Selection

Cut, Copy, Paste and Insert

Cut, Copy, Paste, and Insert can be invoked by activating the popup menu and selecting the desired action, or by using keyboard shortcuts (refer to figure 2).

Colour Interpolation

Interpolated colour ramps can be created in the following ways:

Figure 3 - An example of an interpolated colour ramp.

Fine Tuning

Once an index or range of indices has been selected, fine tuning can be invoked by activating the popup menu and selecting Fine Tune. Fine tuning provides a way to add or remove up to 25% of the selections red, green or blue components, or the brightness value of the colour.

Note: Fine tuning may affect any interpolation effects, as can be expected.

figure 4 - An example of fine tuning the colour of a range of indices.

HSV-RGB Colour Selection

The colour of a selected index may be picked from an HSV colour wheel by activating the popup menu and selecting HSV Pick.

Figure 5 - An example of HSV-RGB colour selection.

The colours HSV or RGB values can be adjusted using the sliders on the left side of the dialog, or by entering the value in the edit boxes to the right of the sliders.

Note: The return key must be pressed after editing in the boxes.

The hue and saturation of the colour can be selected on the rainbow colour wheel with the mouse by pressing the left mouse button to select a colour, and moving the mouse to adjust the selection.  The hue line and saturation circle are drawn to aid in the selection.

The large box below the colour wheel shows the current selection.  The selection is automatically applied.

The smaller box below the colour value slider shows the original colour.  To revert to this colour, click the left mouse inside this box.

If the colour picker is closed, the colour remains as it appears on the Palette page.

Note: The HSV colour wheel, like the colour sliders, only works on a single selection, or the first selection in a range.

Saving Colourmaps

The user is able to save the current page, save all pages, or revert to the last saved version of the current page.

If a page is not modified, it will not be saved.

If a page was loaded at the command line (with a specific filename), then the page is saved to that filename.

If a page has a default name (a new colourmap with no associated filename) then the first time it is saved a message appears with options to save, not save or rename the colourmap.

If modified colourmaps exist upon selecting Exit or closing the Palette window, the user is prompted for whether or not to save.

Credits

Joanne Penner - Palette Implementation and Documentation, vL1.0

New in vL1.0

Savemap and Loadmap functions are now obsolete. Saving and loading functionality is included within this version of Palette.

To load colourmap files, use the -m[pg#] flag to specify the filename(s) (refer to Palette Execution).

To save colourmap files, use the Save Page or Save All popup menu option. (refer to Saving Colourmaps).

Lines similar to the following may appear in specifications files for previous versions.
    colormap:
      loadmaps:
        loadmap plant.map ; loadmap -c2 plant.map2
      savemaps:
        savemap plant.map ; savemap -c2 plant.map2
      palette:
        palette
The lines should be edited to be in the format of the following line.
    colormap:
      palette:
        palette -m1 plant.map -m2 plant.map2

VLAB Home

Last updated December, 2001 by Joanne Penner