Reputation: 11
Hi wanted to get the list of pixel color values(RBG) from an image using Javascript so that i can get interesting colors from an image .can anyone help me on this issue please...
thanks in advance
Upvotes: 1
Views: 2927
Reputation: 1924
try to create canvas element, draw image on i and then use array of pixeldata from it:
data = canvas.getImageData(x, y, 1, 1).data;
it gives you array with RGBA colors
Upvotes: 2