gpu.js icon indicating copy to clipboard operation
gpu.js copied to clipboard

Is it possible to analyze pixels in canvas?

Open Alexxosipov opened this issue 2 years ago • 1 comments

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]}, ]

Alexxosipov avatar Apr 12 '22 08:04 Alexxosipov

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

suspicious-pineapple avatar Oct 16 '22 00:10 suspicious-pineapple