Skip to content
cosmodev ~/tools/palette-from-image

พาเลตต์สีจากภาพ

Images & Media

สกัดสีเด่นจากภาพใด ๆ ออกมาเป็นพาเลตต์ที่ใช้ซ้ำได้ — การ quantize แบบ median-cut พร้อมสัดส่วนความนิยม ค่า hex และ rgb คัดลอกได้ — ทำงานในเบราว์เซอร์ของคุณทั้งหมด

เลือกรูปภาพเพื่อดึงพาเลตสี

(เอกสารเป็นภาษาอังกฤษ)

Palette from Image

What it does

Extracts the dominant colors of any image as a working palette: 4, 8, 12 or 16 swatches, each with its hex and rgb value and the share of the image it covers. The quantization is median-cut — the image is down-sampled, split repeatedly along its widest color channel, and each bucket averages into one swatch — implemented from scratch, with the same logic available as a Go CLI twin.

Runs locally; the image never uploads.

How to use

  1. Drop an image (photos, screenshots, logos, artwork all work).
  2. Pick the swatch count.
  3. Copy individual hex values or the whole palette as a list.

Examples

A brand hero photo typically yields 4-6 saturated swatches plus neutrals — the darker half of the list often forms a ready text/background pair.

A logo with flat colors returns exactly those colors, with population shares reflecting their coverage.

Good to know

  • Down-sampling to ≤96 px keeps results stable for huge photos.
  • Population share is measured over sampled pixels, not exact pixel counts.
  • The swatches pair well with the Color Picker and Contrast tools for building a compliant palette.
ซอร์สโค้ด14 ภาษา

100% ฝั่งไคลเอนต์ · ข้อมูลของคุณไม่ออกจากเบราว์เซอร์ของคุณเลย ใช้แล้วเป็นประโยชน์ไหม แชร์ให้เพื่อนร่วมงานได้เลย