Code Monkey home page Code Monkey logo

image-compressor's Introduction

Image Compressor

A tool to compress image by reducing the number of colors using K-Means Algorithm.

Description ๐Ÿ“’

Image Compressor uses the K-means algorithm for image compression by reducing the number of colors that occur in an image to only those that are most common in that image.
The K-means algorithm is a method to automatically cluster similar data examples together.
In a straightforward 24-bit color representation of an image, each pixel is represented as three 8-bit unsigned integers (ranging from 0 to 255) that specify the red, green and blue intensity values.
An Image contains thousands of colors, and so Image Compressor will reduce the number of colors to 16 colors.
By making this reduction, it is possible to represent (compress) the photo in an efficient way.
Specifically, you only need to store the RGB values of the 16 selected colors, and for each pixel in the image you now need to only store the index of the color at that location (where only 4 bits are necessary to represent 16 possibilities).

How it works โ“

Step 1: Copy & Paste your image in project directory. Modify 'compressor' script to read from your image filename.
Step 2: Run 'compressor' script in your Octave/Matlab command window.
Step 3: This run 10 iterations, first to train & then outputs the compressed image.

Output

Development

Want to contribute? ๐Ÿ“

To fix a bug or enhance an existing module, follow these steps:

  1. Fork the repo
  2. Create a new branch (git checkout -b exciting-stuff)
  3. Make the appropriate changes in the files
  4. Add changes to reflect the changes made
  5. Commit your changes (git commit -am 'exciting-stuff!!')
  6. Push to the branch (git push origin exciting-stuff)
  7. Create a Pull Request

Interested?

If you find a bug (the website couldn't handle the query and / or gave irrelevant results), kindly open an issue here by including your search query and the expected result.

If you'd like to request a new functionality, feel free to do so by opening an issue here including some sample queries and their corresponding results.

How to Build

  • launch Octave/Matlab
  • select Open command window
  • select the project folder
  • type 'classifer' on command window

Articles to Learn

image-compressor's People

Contributors

thegenuinegourav avatar

Stargazers

 avatar Jyoti Jaiswal avatar Sanjay kumar avatar

Watchers

James Cloos avatar  avatar

Forkers

sanjay0-4-zz

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.