(palette-readpng filename)
This procedure reads a palette from a PNG file. If the dimensions do not qualify for a palette, an error is signalled.
The palette is returned in “folded” format (256x256).
(define (palette-readpng filename)
(palette-fold! (colormap-readpng filename)))
> (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>
>