Skip to content

Image compressor in Haskell based on K-Means algorithm

License

Notifications You must be signed in to change notification settings

rclovis/Image-Compressor

Repository files navigation

Image Compressor

This project is about coding an image compressor in Haskell based on K-Means algorithm

Usage:

Compiling:

This project is based on stack, but uses makefile to compile the program.

To compile the program, run the following command:

make

Running:

To run the program, run the following command with the desired parameters:

./imageCompressor [image_name] [k] [n]
  • image_name: The name of the image you want to compress
  • k: The number of colors you want to compress the image to
  • n: The precision of the compression (the lower the number, the more precise the compression)

Warning

Your image must be in the images folder and must be in .jpg format

Examples:

./imageCompressor.py mona-lisa.jpg 5 0.1

Original image

images

Compressed image

images

./imageCompressor.py velocity-design-comfort.jpg 10 5

Original image

images

Compressed image

images

About

Image compressor in Haskell based on K-Means algorithm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages