Implementing Magic Wand for HTML5 <canvas>?

Can someone give directions on how to implement a magic wand tool for cropping images (w / tolerance) using an element?

The idea is to give the user the ability to crop the background of the image based on the color values ​​provided with a certain number of files.

+4
source share
1 answer

It will be very similar to Flood fill . If you decide to implement one of the related algorithms, you should use a non-recursive queue based on JavaScript, as it is not very good for recursive calls. I did not implement Flood filling myself, but it is very similar to Magic Wand.

+5
source

Source: https://habr.com/ru/post/1386756/


All Articles