Coder Social home page Coder Social logo

k-means-image-compressor's Introduction

K-Means Image Compressor

imagen

Overview

The K-Means Image Compressor is a straightforward Flask web application that employs the K-Means clustering algorithm for image compression. This tool allows users to reduce the color palette of images, thereby compressing them. In addition to providing a means for compression, the application also offers visualizations to help users understand the clustering process and the impact on the compressed image. A selection of sample images is included for quick testing.

Setup

Prerequisites

To run this application, you'll need Python 3.x and Git installed on your computer.

Installation

Use Git to clone the project's repository to your local machine.

git clone https://github.com/rodmarkun/K-Means-Image-Compressor && cd K-Means-Image-Compressor/

Install the necessary Python packages.

pip install -r ./requirements.txt

Usage

To run the web server, execute the following command:

python app.py

Then, navigate to http://127.0.0.1:5000/ in your web browser. You can upload a PNG image to compress and view the compression results and various generated plots. Please take into account that, the larger the image to compress, the higher the load on your CPU will be. For a standard CPU it is recommended not to upload >4Mpx PNG images (2000x2000px) to avoid long waiting times.

How does it work?

The application uses the K-Means clustering algorithm to analyze the colors in an image and group them into clusters. This process reduces the overall number of colors in the image, which in turn compresses the image. The application provides plots that show how the algorithm groups colors and the effect on the final image. This straightforward approach offers a glimpse into how unsupervised learning algorithms can be applied for practical purposes like image compression.

k-means-image-compressor's People

Contributors

rodmarkun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.