Floodfill

Johan Forsberg <[email protected]>
Newsgroups gmane.comp.python.image
Message-ID <[email protected]>
Hello,

I have been using PIL to write a simple drawing program and it's been great
fun. The only thing I've really been missing from the library is a fast
flood-fill routine. The included python based floodfill, while functional,
is very slow (in 1.1.7), I guess due to the per-pixel access required. Since
I want interactive speed, I decided to try and hack in a floodfill function
in C. Instead of reinventing the wheel, I googled up a nice implementation
in the "graphics gems" collection (
http://tog.acm.org/resources/GraphicsGems/) which needed only small
modifications in order to work with the PIL code. I havent benchmarked it
but it's (not surprisingly) orders of magnitudes faster than the python
routine. I've only implemented it for 8-bit palette image formats since
that's what I use, but it should be easy to generalize.

Would it be a good idea to clean this up and submit it as a patch to PIL?
The graphics gems license is very liberal and seems to me to be compatible
(this is what I found on the webpage above):

---8<---
The Graphics Gems code is copyright-protected. In other words, you cannot
claim the text of the code as your own and resell it. Using the code is
permitted in any program, product, or library, non-commercial or commercial.
Giving credit is not required, though is a nice gesture.
---8<---

Cheers,
Johan

_______________________________________________
Image-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/image-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.