Skip to content

A streamlit webapp that can be used to compress images. It uses K-Means clustering algorithm in the backend to compress images

License

Notifications You must be signed in to change notification settings

Encode-PDEU/k-means-compressor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Compression with K-Means Clustering

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.

How to Run?

Locally

  1. Clone the repository:

    git clone https://github.com/Kunal-Kumar-Sahoo/k-means-compressor.git
  2. Navigate to the project directory:

    cd k-means-compressor/
  3. Install the required dependencies:

    pip install -r requirements.txt
  4. Run the streamlit app:

    streamlit run app.py
  5. Access the application in your browser at http://localhost:8501

Using Docker

  1. Build the docker image:

    docker build -t kmeanscompressor
  2. Run the docker container:

    docker run -p 8501:8501 kmeanscompressor
  3. Access the application in your browser at http://localhost:8501

Project Structure

  • 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.

Requirements

  • Python 3.10
  • Streamlit
  • scikit-learn
  • scikit-image
  • seaborn
  • matplotlib
  • Pillow

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Inspired by the power of image compression algorithms.

Feel free to contribute and open issues if you encounter any problems!

About

A streamlit webapp that can be used to compress images. It uses K-Means clustering algorithm in the backend to compress images

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 94.3%
  • Dockerfile 5.7%