Data, Maps, Usability, and Performance

API canvas d3 data geo GeoJSON html5 image JavaScript json maps mysql PHP WordPress

Results for tag: color

Color Palette from Photos with HTML5 Canvas

Color Palette with JavaScript

Do you remember ColorAPI? What happened to it? Well, it got me thinking about creating my own color scheme generator from a online photos using HTML5 CANVAS and JavaScript. A little research landed me on Andrey Okonetchnikov’s Colorist. I glanced at the code (I put it on JSFiddle if you want to take a look) and realized that the script does calculations around average color of different slices of the dropped image. I like this approach, it is fast, but I wish that I could limit the amount of colors on the palette to a certain number.

This script does not do that because when colors from different slices are similar, the getAverageColor function combines them to make a new color, so the amount of colors you get on your palette depends on the image. This is important because we don’t want to have very similar colors on the palette. However, we do want to limit the amount of colors, so how can this be done?
Read more