GithubHelp home page GithubHelp logo

colorextractor's Introduction

ColorExtractor

This tool extracts the dominant color of images, and then classifies them according to that color.

Simple Extractor

This program was created first, and works really simply : it just takes one image, resizes it to a 1x1 image, and the main color is the one of the one pixel composing the image. As you might expect it, it doesn't really work as it does an average of all the colors, and that is not really what we want.

Second Extractor

This program is the current version of the code. It works rather differently than the original program : instead of doing an average of all the colors, it does a local average, on the pixels that are already kind of the same color.

Algorithm explained :

  • The image is resized, just for speed purpose.
  • Each pixel becomes a point with its red, green and blue components as its coordinates
  • Blobs of a certain range (defined by the .pde files in tests folder) are created around the points, and we average the one that has most points to get the average color.
  • One we have every image dominant color, we classify them following the hue, then the saturation, and finally the value in needed

Improvements in mind

Maybe using the median instead of doing an average is more accurate. I also need to rethink the way image are classified, hue isn't that pretty.

colorextractor's People

Contributors

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