Pike v8.1 release 6

Method Image.Colortable()->reduce()


Method reduce

object reduce(int colors)
object reduce_fs(int colors)

Description

reduces the number of colors

All needed (see create) colors are kept.

reduce_fs creates and keeps the outmost corners of the color space, to improve floyd-steinberg dithering result. (It doesn't work very well, though.)

Parameter colors

target number of colors

Returns

the new Colortable object

Note

this algorithm assumes all colors are different to begin with (!)

reduce_fs keeps the "corners" as "needed colors".

See also

corners