quantize

package
v0.0.0-...-a03d70d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MedianCutQuantizer

type MedianCutQuantizer struct {
	NumColor int
}

MedianCutQuantizer constructs a palette with a maximum of NumColor colors by iteratively splitting clusters of color points mapped on a three-dimensional (RGB) Euclidian space. Once the number of clusters is within the specified bounds, the resulting color is computed by averaging those within each grouping.

func (*MedianCutQuantizer) Quantize

func (q *MedianCutQuantizer) Quantize(dst *image.Paletted, r image.Rectangle, src image.Image, sp image.Point)

func (*MedianCutQuantizer) UseExistingPalette

func (q *MedianCutQuantizer) UseExistingPalette(dst *image.Paletted, r image.Rectangle, src image.Image, sp image.Point, palette color.Palette)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL