AbstractStaticgetExtracts a semantic theme (Vibrant, Muted, Dark, Light) from the image. Uses Median Cut to find candidates and then scores them based on saturation and luminance targets.
The raw pixel data (RGBA).
Extraction options (count defaults to 64 for better accuracy).
A theme object containing the 6 standard variations.
StatickExtract a color palette from an array of pixel data (RGBA). This implements K-Means Clustering (Lloyd standard / Naive K-Means).
The raw pixel data (e.g. from Canvas
getImageData().data). Must be in RGBA format (4 bytes per pixel,
0 - 255 for all channels including alpha).
Configuration options.
An array of Rgb colors representing the palette. *
StaticmedianExtract a color palette using the Median Cut algorithm. Fast, deterministic, and good for preserving color diversity.
The raw pixel data (e.g. from Canvas
getImageData().data). Must be in RGBA format (4 bytes per pixel,
0 - 255 for all channels including alpha).
Only count, sampleFactor, and sortBy are used.
Module for extracting color palettes from raw image data.