1

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

sattanaathan
  • 11
  • 1
  • 2
  • possible duplicate of [JavaScript eyedropper (tell colour of Pixel under mouse cursor)](http://stackoverflow.com/questions/1936021/javascript-eyedropper-tell-colour-of-pixel-under-mouse-cursor) – Pekka Aug 18 '10 at 11:27
  • 1
    Marking as a duplicate because the accepted answer deals with getting the colour value from an image. – Pekka Aug 18 '10 at 11:27
  • possible duplicate of [How to use javascript or jQuery to read a pixel of an image?](http://stackoverflow.com/questions/1041399/how-to-use-javascript-or-jquery-to-read-a-pixel-of-an-image) – Andy E Aug 18 '10 at 11:28

1 Answers1

2

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

qqryq
  • 1,814
  • 3
  • 18
  • 20