Back to Node List

Palette Extract

palette_extract

Extracts an exact or representative palette from an image

Reviewed
Guide available
The node name and summary are available in English. Port, parameter, and article details are currently shown in Japanese.

Input Ports

NameTypeDescription
画像
input
Image
Required
色を調べたい画像です

Output Ports

NameTypeDescription
パレット
palette
Palette
画像から取り出した色の一覧です
元画像の色数
source_color_count
Int
代表色への統合や最大色数での切り詰め前に、元画像で数えた異なる色の数です

Parameters

NameTypeDefaultRangeDescription / Options
抽出モード
extract_mode
Enum
Exact

実際の使用色をそのまま取るか、近い色をまとめて代表色化するかを選びます

  • 実色抽出Exact
    画像で実際に使われている色を、そのまま頻度順で残します。
  • 代表色抽出Representative
    近い色をまとめて代表色にし、減色向けのパレットを作ります。
残す最大色数
max_colors
Int
161–256

抽出結果のパレットに残す最大色数です。代表色抽出では、この数を目安に近い色をまとめます。

透明も含める
include_transparent
Bool
false

完全に透明なピクセルも色として数えます

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 → Exact for actual colors ordered by frequency; photograph or complex image → Representative for representative colors.
  • To borrow only a reference image's scheme: chosen image → Representative with 4–8 colors → use that palette to gradient_map / quantize your own asset.
  • It also checks color counts. source_color_count reports distinct source colors before merging or truncation, while _count reports colors actually emitted in the palette. Comparing them shows whether max_colors omitted or merged colors.

Common pitfalls

  • Colors are not ordered by brightness: Exact extraction orders by frequency. A gradient_map ramp needs dark → light order, so reorder it with palette_edit or rebuild it with palette_create.
  • Tiny color differences inflate the count: anti-aliasing or translucent edges are responsible. Reduce max_colors or merge them with Representative.

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.
  • _count is the number of colors actually emitted, after representative merging and max_colors truncation.
  • source_color_count is the number of distinct colors considered after applying the transparent-color setting but before merging or max_colors truncation.

Examples

  1. Extract a palette from existing pixel art.
  2. Prepare a recoloring workflow with Palette Extract -> Palette Swap.
  3. Use source_color_count to confirm that an asset uses no more than 16 source colors.
  4. Include transparent colors to inspect the color composition of a UI asset.
  5. 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 point
  • palette_quantize / dither — extract and quantize together
  • palette_edit — reorder or adjust extracted results
  • palette_save — save the extracted palette to a file
Back to Node List
Palette Extract — PixPipeline Node Reference