Image Compression App Overview This Streamlit-based Python application performs image compression using the K-means clustering algorithm. It allows users to upload an image, select the number of colors (k) for compression, and download the compressed image.
Features Upload Image: Users can upload JPEG, PNG, or JPEG images. Compression Slider: Adjustable slider for selecting the number of colors (k) for image compression. Visual Output: Display of both original and compressed images using Streamlit's image display capabilities. Downloadable Result: Option to download the compressed image in JPEG format. Installation Clone the repository: git clone https://github.com/your-username/image-compression-app.git cd image-compression-app Install dependencies:
Copy code pip install -r requirements.txt Usage Run the Streamlit app:
streamlit run app.py
Open your web browser and navigate to the URL provided by Streamlit (usually http://localhost:8501).
Upload an image using the file uploader. Adjust the slider to choose the number of colors (k) for compression. View the original and compressed images side by side. Click on "Download Compressed Image" to save the compressed image to your local machine. Technologies Used 1.Python 2.Streamlit 3.NumPy 4.PIL (Python Imaging Library)