Skip to content

MATLAB project which takes in as input a picture and outputs that same photo using only the desired number of colours

thakurtushar02/Picture-Compressor

Repository files navigation

Picture-Compressor With K-Means Clustering

MATLAB project which takes in as input a picture and outputs that same photo using only the desired number of colours

Simply put an image in the same folder as the rest of the files, run script file named ConvertImage.m.

Then type in the full name of the image "example.jpg" when prompted.

Next type the number of colours you would like in the final creation.

Add a maximum number of iterations before it forcefully stops (put number > 500 if you don't care about how long it takes --> Might take VERY long)

Wait 10-15 seconds if it's a large photo.

Voila!

Example Image:

Tree

Using my program, I can convert the above into an image with (for example) 3 colours!

3colourTree

Notice how there are only three colours in the second image. The second image is also smaller (in kB) than the first one.

Have fun!

About

MATLAB project which takes in as input a picture and outputs that same photo using only the desired number of colours

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages