gpu.js
gpu.js copied to clipboard
Is it possible to analyze pixels in canvas?
Hey there! I've checked documentation and I didn't find anything about analyzing pixels without drawing an image.
For example: a have a canvas on the page. I need to analyze it and find pixels' coordinates by its RGB value. How can I do it with gpu.js? Let's say I need to find all coordinates for pixel [0,255,0] and [255,0,0] with output of:
[ {x: 1, y:1, rgb: [0,255,0]}, {x: 100, y:100, rgb: [255,0,0]}, ]
if you need one specific output, you will likely be better off not using the GPU. the GPU excels when you need thousands of outputs, not one.
also, you can process the output of canvas.getContext('2d').getImageData
just fine with gpu.js