sattanaathan
sattanaathan

Reputation: 11

Pixel Color Values of image using Javascript

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

Answers (1)

qqryq
qqryq

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

Related Questions