Versions in this module Expand all Collapse all v0 v0.1.0 May 28, 2026 Changes in this version + var Version = "dev" + func EncodeAnimatedGIF(w io.Writer, frames []*image.RGBA, delaysCS []int, loopCount int) error + func EncodeGIF(w io.Writer, frames []*image.RGBA, opts GIFOptions) error + func EuclideanRGBA(a, b color.Color) float64 + func RunBatch(ctx context.Context, jobs []BatchJob, opts BatchOptions, ...) error + func Watch(ctx context.Context, path string, onChange func() error) error + func WriteBuildMap[M any](w io.Writer, p *Pattern[M]) error + func WritePiecesCSV[M any](w io.Writer, p *Pattern[M]) error + type ApplyOptions struct + Distance DistanceFunc + Dither bool + Height int + Resize ResizeMode + Width int + type BatchJob struct + InputPath string + OutputPath string + func CollectJobs(inDir, outDir, outExt string, opts BatchOptions) ([]BatchJob, error) + type BatchOptions struct + Extensions []string + Workers int + type Bucket struct + Count int + Entry Entry[M] + Index int + type DistanceFunc func(a, b color.Color) float64 + type Entry struct + B uint8 + G uint8 + Meta M + R uint8 + func (e Entry[M]) Color() color.RGBA + type EntryMeta struct + Hex string + ID string + More map[string]string + Name string + func (m EntryMeta) GetHex() string + func (m EntryMeta) GetID() string + func (m EntryMeta) GetName() string + type GIFOptions struct + DelayMS int + Loop LoopMode + LoopCount int + type Hexed interface + GetHex func() string + type Identified interface + GetID func() string + type LoopMode int + const LoopFull + const LoopNone + const LoopReverse + type Named interface + GetName func() string + type Palette []Entry[M] + func LoadCSV(r io.Reader) (Palette[EntryMeta], error) + func LoadFile(path string) (Palette[EntryMeta], error) + func LoadGPL(r io.Reader) (Palette[EntryMeta], error) + func LoadHEX(r io.Reader) (Palette[EntryMeta], error) + func LoadJSON(r io.Reader) (Palette[EntryMeta], error) + func (p Palette[M]) Apply(ctx context.Context, img image.Image, opts ApplyOptions) (*Pattern[M], error) + func (p Palette[M]) ColorPalette() color.Palette + func (p Palette[M]) Swatch(opts SwatchOptions) *image.RGBA + type Pattern struct + Image *image.RGBA + Indices [][]int + Palette Palette[M] + Usage map[int]int + func (p *Pattern[M]) Dominant(n int) []Entry[M] + func (p *Pattern[M]) Histogram() []Bucket[M] + func (p *Pattern[M]) Stats() StatsJSON[M] + func (p *Pattern[M]) UniqueColors() int + func (p *Pattern[M]) WriteStatsJSON(w io.Writer) error + type ResizeMode int + const BiLinear + const BlockAverage + const CatmullRom + const NearestNeighbor + type StatsJSON struct + Height int + Histogram []Bucket[M] + PaletteSize int + TotalPixels int + UniqueColors int + Width int + type SwatchOptions struct + CellSize int + Columns int