Documentation
¶
Overview ¶
Package imageutil provides helpers for decoding images into weighted pixel samples.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type WeightedPixel ¶
WeightedPixel is a color sample with a weight in [0.0, 1.0]. Weight reflects alpha: fully opaque = 1.0, fully transparent = 0.0.
func Pixels ¶
func Pixels(img image.Image) []WeightedPixel
Pixels returns all non-transparent pixels from the image as WeightedPixels. Fully transparent pixels (alpha == 0) are skipped. Semi-transparent pixels are included with weight = alpha / 65535. Fully opaque pixels have weight 1.0.
Click to show internal directories.
Click to hide internal directories.