Vibrant.js - Extract prominent colors from an image.
▻http://jariz.github.io/vibrant.js
Extract prominent colors from an image.
Vibrant.js - Extract prominent colors from an image.
▻http://jariz.github.io/vibrant.js
Extract prominent colors from an image.
(Tiens d’ailleurs je n’ai jamais réussi à faire marcher ce truc en local… Vous oui ?)
La version node-vibrant marche pour moi.
mkdir vibrant
cd vibrant
npm init
npm install —save node-vibrant
et puis
var Vibrant = require("node-vibrant") ;
var v = new Vibrant("notabene.jpg", {}) ;
v.getSwatches(function (err, swatches) {
console.log(swatches) ;
}) ;
Avec
comme notabene.jpg ça me donne :{ Vibrant :
{ rgb : [ 158, 108, 76 ],
population : 4,
hsl : [ 0.06504065040650406, 0.3504273504273504, 0.45882352941176474 ] },
Muted :
{ rgb : [ 144, 80, 100 ],
population : 2,
hsl : [ 0.9479166666666666, 0.2857142857142857, 0.4392156862745098 ] },
DarkVibrant :
{ rgb : [ 14, 6, 10 ],
population : 104,
hsl : [ 0.9166666666666666, 0.4, 0.0392156862745098 ] },
DarkMuted :
{ rgb : [ 97, 85, 82 ],
population : 6,
hsl : [ 0.033333333333333236, 0.08379888268156419, 0.3509803921568627 ] },
LightVibrant :
{ rgb : [ 231, 215, 178 ],
population : 59,
hsl : [ 0.11635220125786165, 0.5247524752475247, 0.8019607843137255 ] },
LightMuted : undefined }