utils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractDominantPalette

func ExtractDominantPalette(img image.Image, k int) []colorful.Color

func ExtractKMeansPalette

func ExtractKMeansPalette(img image.Image, k int) []colorful.Color

func ExtractPalette

func ExtractPalette(img image.Image, k int, method PaletteMethod) []colorful.Color

func ReadImage

func ReadImage(path string) image.Image

func SaveGrayImages

func SaveGrayImages(images []*image.Gray, dir string) error

func SaveImage

func SaveImage(img image.Image, filename string) error

func SavePalette

func SavePalette(palette []colorful.Color, tileSize int, filename string) error

func SaveRgbaImages

func SaveRgbaImages(images []*image.NRGBA, dir string) error

func SelectDiverseWeightedColors

func SelectDiverseWeightedColors(cands []weightedColor, k int) []colorful.Color

func SortPaletteByBrightness

func SortPaletteByBrightness(palette []colorful.Color)

SortPaletteByBrightness orders colors from darkest to brightest. The first palette entry becomes the darkest color (background).

Types

type PaletteMethod

type PaletteMethod int
const (
	PaletteMethodDominantColor PaletteMethod = iota
	PaletteMethodKMeans
)

func (PaletteMethod) String

func (m PaletteMethod) String() string

Jump to

Keyboard shortcuts

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