Skip to content

Janjanus/ofxColorFinder

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 

ofxColorFinder

ofxColorFinder is a openFrameworks addon that can give you the dominant color of any image. The following snippet shows how to use the addon:

ofImage image;
image.load("0.jpg");

ofColor dominantColor = ofxColorFinder::getColor(image);

You can also customize the algorithm so it favors colors you specify. This can be done by providing a callback to the ofxColorFinder::getColor() method. The following code favors dark colors:

ofImage image;
image.load("0.jpg");

ofColor dominantColor = ofxColorFinder::getColor(image, [](int r, int g, int b) {
	return 768-r-g-b+1; 
});

Favor hue Favor hue

Favor bright colors Favor bright colors

Favor dark colors Favor dark colors

ColorFinder

This addon is a C++ port of the ColorFinder library written in Javascript by pieroxy. You can read more documentation at his website or see his online demo.

About

An openFrameworks addon that can give you the dominant color of any image.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published