Documentation ¶
Overview ¶
Median implements basic median cut color quantization.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Quantizer ¶
type Quantizer int
Quantizer methods implement median cut color quantization.
The value is the target number of colors. Methods do not require pointer receivers, simply construct Quantizer objects with a type conversion.
The type satisfies both quant.Quantizer and draw.Quantizer interfaces.
func (Quantizer) Palette ¶
Palette performs color quantization and returns a quant.Palette object.
Returned is a palette with no more than q colors. Q may be > 256.
func (Quantizer) Paletted ¶
Paletted performs color quantization and returns a paletted image.
Returned is an image.Paletted with no more than q colors. Note though that image.Paletted is limited to 256 colors.
func (Quantizer) Quantize ¶
Quantize performs color quantization and returns a color.Palette.
Following the behavior documented with the draw.Quantizer interface, "Quantize appends up to cap(p) - len(p) colors to p and returns the updated palette...." This method does not limit the number of colors to 256. Cap(p) or the quantity cap(p) - len(p) may be > 256. Also for this method the value of the Quantizer object is ignored.