[Image-SIG] ImageDraw.ellipse bug

Dave Johnston lists at johnsto.co.uk
Wed Jul 20 21:49:15 CEST 2005

ImageDraw.ellipse appears to have a bug in it from the inaccuracy of the 
code that leads to it drawing ellipses 1 pixel bigger than the specified 
bounding box.

The bug is that ellipses of even-width end up being a pixel wider. For 
example, ellipses draw with bounding boxes of 1x1, 2x2, 3x3, 4x4, 5x5 
are actually drawn using these bounding boxes: 1x1, 3x2, 3x3, 5x4, 5x5.

I don't know if this pattern continues for ever, but the inaccuracy has 
been causing precision errors in generated images and ruining the 
algorithms I've been working on.

Maybe there's a chance that the Bresenham algorithm could be added to 
the library for drawing circles?


More information about the Image-SIG mailing list