Hi Markus,

Is there a function like im.is_empty() ?
um, what is your definition of "empty" exactly? Is it "all pixels are transparent"? Or is it "all pixels are of the same color"? Or is it "all pixels are of color X"? I don't think there's an Image.is_empty() because "empty" means different things to different people.

There are different ways to do that depending on the definition. You can loop over the image pixels with im.getdata() and check some property of an image, or you might want to take a look on im.getcolors() dictionary which tells you how often a color occurs in the image. There's PIL documentation for all the Image methods here: [1].

If you have difficulties writing that down in Python, I'd be happy to help - just drop me a line here.

Bye
Igor

[1] http://www.pythonware.com/library/pil/handbook/image.htm

_______________________________________________
dev mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/dev

Reply via email to