Back
2023
# Applied Maths

Image Compressor

A Haskell application implementing k-means to "compress" images.

~/Tags

HaskellApplied MathsK-Means

~/About

Developed in Haskell as part of a third-year school project, this tool "compresses" images by reducing their color space using the k-means clustering algorithm. The program takes a file as input and allows users to specify parameters such as the number of colors and the convergence threshold. It then processes the image to cluster similar colors together, effectively reducing the overall palette. The final output follows the required school text format, and I added a script to convert this output into a PNG file for easy visualization.

~/Gallery

view
view
Image Compressor 3
view
Image Compressor 4
view

~/Key features

K-means color quantization
Adjustable palette size & convergence
Custom parser for pixel data
Generates compressed PNG output