The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Color-thief Javascript Color Palette generator goodies! Reply To: Color-thief Javascript Color Palette generator goodies!


Hey giving this a bump, I’ve found a nice and simple (if you understand the scripts) example for Color thief on JSfiddle: What I don’t understand is how to simply input the values for new images, and what returns what is seen at the top of the html code section, starting with, I think it’s Canvas, but don’t really get it yet:

<div class="imageSection ">
<div class="imageWrap">
<img class="targetImage" src="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNr

To see the demo in a stand-alone html page use this link:

If anyone out there understands quite how this works, can you give it a quick walk-through. I would like to create a gallery, and have each gallery piece return a color palette, but I honestly can’t quite figure it out from any of the examples out there. Tutorial desperately needed, for non-scripter neophytes. thanks, Crssp