I need to get the color value for each pixel in svg rect element.In canvas we can get it through the method getImageData(x,y,width,height).
In svg,is there any way to do it??If so please give some working examples.
I need to get the color value for each pixel in svg rect element.In canvas we can get it through the method getImageData(x,y,width,height).
In svg,is there any way to do it??If so please give some working examples.
If you create a standalone SVG file and include that in your document via an image element e.g. a html
<img>
element then you can copy the image data into canvas via drawImage and you already know how to extract colour values from canvas.This indirect route is the only way.