M 069 / 18303 Color & Quantizationalgorithm output

K-Means Color Quantization

color, tone & quantization

Typeface · Source Code Pro

Real-world algorithm demonstration, applied to a NASA portrait.
Real-world algorithm demonstration, applied to a NASA portrait.Image: NASA / Eileen Collins · scikit-image (public domain)View source ↗

Prompt

Apply a K-Means Color Quantization effect, reducing the photograph to six representative colors sampled from its existing palette. Replace similar colors with identical flat fills, producing abrupt tonal steps and simplified surface detail while retaining irregular source contours. Avoid dithering and added outlines. Keep the original subject and composition.

Identify

A few surface colors unify the scene.

Principle

K-means1 clusters RGB pixels around a small number of color center values2.

Try it out

Test 6, 12 and 24 colors.

Classification

Calculated image processing result.

Further examples · 7 images

Ada k15 i2
02 Ada k15 i2A portrait of Ada Lovelace is shown with visible color banding in the background and dress. This iteration demonstrates K-Means clustering where pixels are grouped into 15 distinct color centers, creating flat shaded areas.E.Le Morvan · CC BY-SA 4.0 · Wikimedia Commons
Mandrill-k-means
03 Mandrill-k-meansThe standard mandrill test image is rendered with a reduced color palette. The resulting flat color areas demonstrate how pixels are grouped into a small number of discrete RGB centers.Not specified in SIPI Image Database · Public domain · Wikimedia Commons
AI illustration: A woman in a garden is shown with a limited palette of approximately six
04 AI illustration: A woman in a garden is shown with a limited palette of approximately six A woman in a garden is shown with a limited palette of approximately six colors. This illustrates K-means by clustering complex gradients into distinct, unified flat color regions.Illustration generated for the Atlas (AI)
AI illustration: A still life photograph is processed into flat color regions
05 AI illustration: A still life photograph is processed into flat color regionsA still life photograph is processed into flat color regions. It illustrates K-means by grouping continuous gradients into 24 distinct, uniform color clusters based on pixel proximity in RGB space.Illustration generated for the Atlas (AI)
AI illustration: A close-up of an eye shows jagged boundaries between skin and iris tones
06 AI illustration: A close-up of an eye shows jagged boundaries between skin and iris tonesA close-up of an eye shows jagged boundaries between skin and iris tones. The reduction of a photographic source into roughly 12 flat color zones demonstrates algorithmic K-means quantization.Illustration generated for the Atlas (AI)
AI illustration: A cityscape is reduced to a limited palette of neon pink, blue, and dark
07 AI illustration: A cityscape is reduced to a limited palette of neon pink, blue, and dark A cityscape is reduced to a limited palette of neon pink, blue, and dark tones. It illustrates K-means by clustering all pixels into a very small number of discrete color values.Illustration generated for the Atlas (AI)