image-rs / imageproc

Image processing operations
MIT License
758 stars 149 forks source link

New feature: Flood-fill #684

Closed tkallady closed 1 month ago

tkallady commented 2 months ago

Similar to bucket tool in MS-PAINT. I've just taken the algorithm from here: https://en.wikipedia.org/wiki/Flood_fill#Span_filling

I'm fairly new to rust and didn't know how to do generic Pixel equality without first converting to rgba pixel, perhaps someone knows how to do this better?: https://github.com/image-rs/imageproc/blob/d2a187ceecdde5d7e4a4526531d7c0c909dcd227/src/drawing/fill.rs#L61

ripytide commented 2 months ago

Apart from the two new nits, I'm happy for this PR to be merged.

tkallady commented 2 months ago

All done. Thanks.

cospectrum commented 2 months ago

for clippy lint you can merge master, for doc lint just fix url

tkallady commented 1 month ago

CI should pass now.

cospectrum commented 1 month ago

Actually I think clippy will break with each new lint until they run out of ideas. Almost every month

theotherphil commented 1 month ago

Thanks!