graymap->colormap

Synopsis

(graymap->colormap graymap palette)

Parameters

  • graymap: A 16 bit graymap
  • palette: A colormap with exactly 65536 pixels

Description

This procedure converts a 16 bit graymap to a RGB colormap my mapping each gray value as specified in the palette colormap. The palette colormap must contain exactly 65536 colors, one for each possible 16 bit gray value. The palette colormap is accepted either with the dimenstions 65536x1 or 256x256 (in a “folded” format with internally no drawback).

Side Effects

Return Value

The created colormap is returned.

Example

> (define graymap (graymap-readpng "source-e.png"))
graymap
> (define palette (colormap-readpng "testpalette.png"))
palette
> (set! palette (colormap-scale-absolute palette 65536 1))
palette
> (define result (graymap->colormap graymap palette))
result
> result
#<colormap orow:-1 ocol:-1 xres:-1 yres:-1 w:8000 h:5989>
>