Skip to content

Small project to compress an image by grouping similar colors together into clusters using kmeans-clustering to be able to set it as GitHub profile image.

Notifications You must be signed in to change notification settings

iwas-iwas/KMeans_Compression

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

View Project:

https://nbviewer.jupyter.org/github/iwasscience/KMeans_Compression/blob/master/KMeans_Compression.ipynb

Picture Compression Project

cluster_error

In a coloured image, each pixel is of size 3 bytes (RGB), where each colour can have intensity values from 0 to 255. Image compression is a type of data compression applied to digital images, to reduce their cost for storage or transmission.

This project shows how this can be done using the KMeans Clustering technique.

before_after

Motivation

Small project to compress a picture using kmeans-clustering for the RGB-values of each pixel to be able to set it as GitHub profile picture.

Tools:

skimage, pandas, numpy, sklearn (KMeans-Clustring)

Structure:

Explore original image and preprocessing

  • load pixel (rgb-values)
  • view shape and size
  • rearange pixel dimensions for KMeans

Applying KMeans-Cluestering

  • create rgb-color value centers (centroids)
  • assign each pixel (rgb) the nearest centroid

Conclusion/New GitHub profile picture

  • compare metrics of original image with new one
  • compressed picture size is small enough to be a github profile picture

About

Small project to compress an image by grouping similar colors together into clusters using kmeans-clustering to be able to set it as GitHub profile image.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published