imagecolours

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package imagecolours provides shared helpers for extracting colour palettes from images and saving generation metadata. Used by AI input plugins.

Index

Constants

View Source
const (
	// MainColorWeightRatio is the proportion of total weight allocated to
	// main palette colors when region extraction is enabled (90%).
	MainColorWeightRatio = 0.9

	// RegionWeightFactor determines how much weight region colors receive
	// relative to main palette colors. Region colors get 10% of the total weight.
	RegionWeightFactor = 0.1
)

Variables

This section is empty.

Functions

func ExtractColors

func ExtractColors(imagePath string, verbose bool) (*colour.Palette, error)

ExtractColors extracts a colour palette from the image at imagePath. It honours all commonflags settings (seed mode, colour count, region extraction).

func SaveMetadata

func SaveMetadata(imagePath string, metadata any) error

SaveMetadata saves generation metadata as a JSON file alongside the image. metadata may be any JSON-serialisable value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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