What is it for?
- Reuse colors from an existing image unchanged
- Check how many colors are used
- Automatically create the source palette for
Palette Swap - Merge nearby colors into a representative palette for quantizing
Overview
Collects colors from an image into a palette. Reusing a pixel-art color scheme,
checking the color count, or making the source palette for palette_swap—every
image → palette conversion belongs here. The reverse palette → image direction uses
quantize or gradient_map.
Usage tips
- Choose by source: finished pixel art →
Exactfor actual colors ordered by frequency; photograph or complex image →Representativefor representative colors. - To borrow only a reference image's scheme: chosen image →
Representativewith 4–8 colors → use that palette togradient_map/quantizeyour own asset. - It also checks color counts.
source_color_countreports distinct source colors before merging or truncation, while_countreports colors actually emitted in the palette. Comparing them shows whethermax_colorsomitted or merged colors.
Common pitfalls
- Colors are not ordered by brightness: Exact extraction orders by frequency. A
gradient_mapramp needs dark → light order, so reorder it withpalette_editor rebuild it withpalette_create. - Tiny color differences inflate the count: anti-aliasing or translucent edges are
responsible. Reduce
max_colorsor merge them withRepresentative.
Notes
- Extraction order is deterministic. The same image always produces the same result.
実色抽出returns only colors that exist in the source.代表色抽出merges nearby colors, so it can produce a representative color not present verbatim in the source.- With
include_transparent = false, fully transparent pixels are ignored. _countis the number of colors actually emitted, after representative merging andmax_colorstruncation.source_color_countis the number of distinct colors considered after applying the transparent-color setting but before merging ormax_colorstruncation.
Examples
- Extract a palette from existing pixel art.
- Prepare a recoloring workflow with
Palette Extract -> Palette Swap. - Use
source_color_countto confirm that an asset uses no more than 16 source colors. - Include transparent colors to inspect the color composition of a UI asset.
- Summarize a photograph or complex image as a small palette with
代表色抽出.
Related nodes
palette_swap— replace a color scheme using the extracted palette as a starting pointpalette_quantize/dither— extract and quantize togetherpalette_edit— reorder or adjust extracted resultspalette_save— save the extracted palette to a file