Skip to content

zeakd/rothko.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rothko.js

get dominant, chroma, achroma, and point colors in photo, with some data of colors.

Install

requirejs

commonjs

script tag

You should install latest version of dependencies, chroma, drawing-kit, histogram-analyze.

    <body>
        ...
        <script src="path/to/chroma.js"></script>
        <script src="path/to/drawing-kit.js"></script>
        <script src="path/to/histogram-analyze.js"></script>
        <script src="path/to/rothko.js"></script>
        <script src="your/script/file"></script>
    </body>

Usage

browser

var img = new Image();
img.src = "path/to/image"
var roth = Rothko(img);

img.onload = function () {
    var colors = roth.getColorsSync();
    console.log(colors.dominants,
                colors.points,
                colors.chromas,
                colors.achromas);
}