colormap-compose

Synopsis

(colormap-compose red-greymap green-greymap blue-greymap)

Parameters

  • red-greymap
  • green-greymap
  • blue-greymap

Description

This procedure composes a new colormap by setting each channel to the supplied 8 bit greymap. The dimensions of the three greymaps have to be identical.

Side Effects

Return Value

The resulting new colormap is returned.

Example

> (set-mandelbrot-interior-mode! 0)
ok
> (define precomputed-graymap (mandelbrot -2.0 1.0 -1.5 1.5 200 1000))
precomputed-graymap
> (define red (buddhabrot precomputed-graymap 10 200))
red
> (define green (buddhabrot precomputed-graymap 10 400))
green
> (define blue (buddhabrot precomputed-graymap 10 800))
blue
> (graymap-equalize! red)
#<graymap(16) orow:-1 ocol:-1 xres:-1 yres:-1 w:1000 h:1000>
> (graymap-equalize! green)
#<graymap(16) orow:-1 ocol:-1 xres:-1 yres:-1 w:1000 h:1000>
> (graymap-equalize! blue)
#<graymap(16) orow:-1 ocol:-1 xres:-1 yres:-1 w:1000 h:1000>
> (define red-g (graymap-high->greymap red))
red-g
> (define green-g (graymap-high->greymap green))
green-g
> (define blue-g (graymap-high->greymap blue))
blue-g
> (define result (colormap-compose red-g green-g blue-g))
result
> (colormap-writepng result "colormap-compose.png")
ok
>

The resulting PNG file displays as follows:

colormap-compose.png

A very quick postprocessing with Affinity Photo (inversion and adjusting contrast and brightness) results in this:

colormap-compose2.jpg