This project is a simple image compression application using the K-Means clustering method. Users can upload an image, choose the number of colors (clusters) for compression, and view/download the compressed image.
-
Clone the repository:
git clone https://github.com/Kunal-Kumar-Sahoo/k-means-compressor.git
-
Navigate to the project directory:
cd k-means-compressor/
-
Install the required dependencies:
pip install -r requirements.txt
-
Run the streamlit app:
streamlit run app.py
-
Access the application in your browser at http://localhost:8501
-
Build the docker image:
docker build -t kmeanscompressor
-
Run the docker container:
docker run -p 8501:8501 kmeanscompressor
-
Access the application in your browser at http://localhost:8501
image_compression.py
: Contains the ImageCompression class for handling image compression using K-means clustering.streamlit_app.py
: Defines the StreamlitApp class for the Streamlit web application.
- Python 3.10
- Streamlit
- scikit-learn
- scikit-image
- seaborn
- matplotlib
- Pillow
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by the power of image compression algorithms.
Feel free to contribute and open issues if you encounter any problems!