palette-readpng

Synopsis

(palette-readpng filename)

Parameters

  • filename

Description

This procedure reads a palette from a PNG file. If the dimensions do not qualify for a palette, an error is signalled.

Side Effects

Return Value

The palette is returned in “folded” format (256x256).

Implementation

(define (palette-readpng filename)
 (palette-fold! (colormap-readpng filename)))

Example

> (define p (palette-create))
p
> (palette-writepng p "p001.png")
ok
> (define q (palette-readpng "p001.png"))
q
> (colormap-equal? p q)
#t
> q
#<colormap orow:-1 ocol:-1 xres:-1 yres:-1 w:256 h:256>
>