That is pretty neat. My gut feeling says the trapezoid method would usually be faster, and much lower memory use, but I can see three cases where you'd prefer using mask.count(): - It can handle an infinitely weird polygon set (crossed edges, cutouts, etc). - Will give you a 100% exact pixel count if you need it. - It's just so much /cooler/ than iterating over vertexes. Ron Nirav Patel wrote:
In Pygame SVN, there are new Mask functions. You could turn the polygon surface into a mask with mask.from_threshold() or mask.from_surface(), and then get the size in pixels with mask.count().