AggregationType specifies the type of aggregation to be done
type AggregationType uint8
const ( // Mode - pick the highest priority value Mode AggregationType = iota // Mean - weighted average all values Mean )
MedianCutQuantizer implements the go draw.Quantizer interface using the Median Cut method
type MedianCutQuantizer struct { // The type of aggregation to be used to find final colors Aggregation AggregationType // The weighting function to use on each pixel Weighting func(image.Image, int, int) uint32 // Whether to create a transparent entry AddTransparent bool }
▹ Example
func (q MedianCutQuantizer) Quantize(p color.Palette, m image.Image) color.Palette
Quantize quantizes an image to a palette and returns the palette