This project has been developed on my own, incrementally through several process with the aim of debugging and improving the source code step by step. The test images used are in PPM format. Digital images take up a considerable amount of data storage space. Compressing them reduces this memory footprint.
The aim of this project was to implement the main steps involved in compressing and decompressing a still image:
- Color quantization using the k-means algorithm
- Creation of a color indexing table (CLUT)
- Image compression and decompression using RLE coding
- Decompression and display
In addition, the project sheet stipulated:
- Possible application of a dithering algorithm
- Performance validation in terms of quality and compression ratios
- Implementation of functionalities in the form of an interactive menu
Clone the repository
https://github.com/Raphaelmos/Kmeansonimage.git
- Compile the code using make
- Run the executable with a source image file and desired number of clusters as arguments
- The image will now appear on your screen, left-click and a menu will appear with many differnet possibilities, to use k-means on the image, select it and in your bash a loading will appear and when at 100%.. Wait a few seconds
Now you see the result of it !
To be fully transparent there's a total of 53 different versions of this project,
V35 is stable, have the functional 3 algorithms but the colors result have a chance to produce unexpected result
V51 is less stable, but have meaningful changes like a histogram that fix the unexpected possible results
Add more and more algorithms, currently have K-means, RLE, Dithering.
Have more formats of images working and not only .ppm
Ce projet a été développé de manière seule et incrémentale au fil de plusieurs itérations et de nombreux essais, dans le but de déboguer et améliorer pas à pas le code source. Les images tests utilisées sont au format PPM. L’image numérique occupe une place considérable dans le stockage de données. Cette com�pression permet de réduire cette empreinte mémoire. L’objectif de ce projet était d’implémenter les principales étapes de la compression et décompression d’une image fixes :
- Quantification des couleurs via l’algorithme des k-means
- Création d’une table d’indexation des couleurs (CLUT)
- Compression et décompression de l’image selon le codage RLE
- Décompression et affichage En outre, la fiche projet stipulait :
- L’application éventuelle d’un algorithme de dithering
- La validation des performances en termes de qualité et ratios de compression
- L’implémentation des fonctionnalités sous forme de menu interactif