Manipulating pixels using only toDataURL
Posted
by Chris
on Stack Overflow
See other posts from Stack Overflow
or by Chris
Published on 2010-03-08T23:31:10Z
Indexed on
2010/03/08
23:36 UTC
Read the original article
Hit count: 338
The problem I have is this: I need to be able to dynamically tint an image using Javascript, but I cannot access pixel data via the canvas. I can, however, store the dataURL (or any other text-based data format) and include that with the code, manipulate that data, and then create an image object using that dataURL.
My question is, how can I access the RGBA value of each pixel, given only the dataURL. I assume I need to decode the base64 url, but into what format in order to manipulate on the pixel level? And then would be it be as trivial as re-encoding it as base64, slapping it in a url, and the passing to an image?
Thanks.
© Stack Overflow or respective owner