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

3

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

2 Comments

In this case, how can you copy the image data to the canvas? Also, how can you "draw image on i"?
Also, is it possible to draw an image from a file onto a canvas, and then get the pixel data from the image?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.