(palette-fold! colormap)
This procedure converts a palette colormap with dimensions 65536x1 to its equivalent with dimensions 256x256 not changing the total number of color pixels. If the palette colormap has already dimensions of 256x256 the colormap dimensions are not altered and the palette colormap is returned unchanged.
The dimensions are changed only if the input dimensions are 65536x1.
The palette colormap is returned.
> (set! cm (colormap-scale-absolute cm 65536 1))
cm
> cm
#<colormap orow:-1 ocol:-1 xres:-1 yres:-1 w:65536 h:1>
> (palette-fold! cm)
#<colormap orow:-1 ocol:-1 xres:-1 yres:-1 w:256 h:256>
> cm
#<colormap orow:-1 ocol:-1 xres:-1 yres:-1 w:256 h:256>
>