GithubHelp home page GithubHelp logo

quantization's Introduction

color-quantization

Color quantization zoo.

This is a repository for exploring various color quantization methods. Algorithm implementations are in src/, with great help from numpy.

Table of Contents

  • Otsu's Method
  • Median Cut
  • Kmeans++
  • Octree
  • Floyd-Steinberg Dithering

Otsu's method - binarization

Otsu's method is an algorithm for color binarization. See src/otsu/.

Colored Otsu's method Median threshold
img img img

Median cut - quantization

Median cut is an algorithm for color quantization of images into 2n colors. See src/median_cut/.

Original 2 color
img img
4 color 8 color
img img
16 color 32 color
img img
64 color 128 color
img img

K-means++ - quantization

K-means++ is an improved K-means algorithm with better initialization. Initializing with sparser centroids (though more computationally expensive) can lead to faster convergence. Note that this algorithm can quantize an image to arbitrary number of colors. See src/kmeans/.

Original 2 color
img img
3 color 5 color
img img
10 color 20 color
img img
50 color 100 color
img img

Octree - quantization

Octrees are trees which each node has (at most) eight children. It is an effective data structure for partitioning 3-dimensional spaces. A great post on octree implementations (in JavaScript) for color quantization can be found here.

Floyd-Steinberg Dithering

Dither is an intentionally applied form of noise used to randomize quantization error, preventing large-scale patterns such as color banding in images. See src/dithering/.

Original 64-colored Dithered
img img img

quantization's People

Contributors

bchao1 avatar

Stargazers

 avatar

Watchers

 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.