Skip to content

Processes images by pixelating them and reducing their color palette to a set of user-specified colors using KMeans clustering and Euclidean distance within the RGB space. The goal is to transform any image into a pattern that can be laid out with different colored tiles.

Notifications You must be signed in to change notification settings

anna-st-40/image_tiling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Tiling

This projects contains a Python script for reducing the number of colors in an image and transforming it into a pixelated version using predefined tile colors. This project uses KMeans clustering to identify dominant colors in the image and maps them to a set of predefined colors.

Demo

Step 0 - Original Image

Original Image

Step 1 - Pixelate image

The image is pixelated to 25×25 pixels by downscaling using the PIL resize function. Pixelated Image

Step 2 - Reduce Colors

The image is reduced to 4 colors using KMeans clustering to find the dominant colors in the image. Reduced Colors

Step 3 - Remap Colors

The four found colors are remapped to a set of predefined colors - red, white, black, and gray.
This is accomplished by calculating the Euclidean distances in RGB space between the found and predefined colors. Remapped Colors

About

Processes images by pixelating them and reducing their color palette to a set of user-specified colors using KMeans clustering and Euclidean distance within the RGB space. The goal is to transform any image into a pattern that can be laid out with different colored tiles.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages