Something Like Gimp "fuzzy Select" In Python/pil
I have image with some object at not solid background. I want to extract this objects like in gimp using 'fuzzy select'. This can be an example: http://img249.imageshack.us/gal.php
Solution 1:
I suppose you would need some flood-fill algorithm (such as breadth-first-traversal) in which you stop exploring pixels with different color than black.
Wikipedia has an excellent explanation with animations and pseudo-code
http://en.wikipedia.org/wiki/Flood_fill
Solution 2:
And besides, if you want to add feature like "tolerance" in Photoshop, you should apply this method Connected-component_labeling when getting connected vertex on your graph while doing flood fill
Solution 3:
As of today, skimage 0.19 has a flood fill algorithm: link
Post a Comment for "Something Like Gimp "fuzzy Select" In Python/pil"