Only try to connect discontiguous corners at the end of edges by radarhere · Pull Request #6303 · python-pillow/Pillow

Hi there, I ran across the scanline issue fixed in this PR myself. Reverting back to 9.0.0 worked fine for me as a fix since I didn't have an issue with the corner points which was the original motivation for these changes. I did notice however that I was also seeing spurious white "fill" points outside the polygon outline. (The spurious points would also appear in some images that don't contain the scanlines.) I'm not sure if that was also fixed in this PR, but thought I'd mention it just in case. The data points for the following polygon image are below just in case it's worth checking out. Thanks!

points = [(1497, 1510), (1500, 1506), (1505, 1509), (1509, 1512), (1513, 1518), (1516, 1522), (1516, 1527), (1515, 1531), (1512, 1534), (1510, 1536), (1507, 1539), (1504, 1542), (1502, 1542), (1498, 1542), (1496, 1540), (1494, 1537), (1490, 1534), (1488, 1529), (1489, 1523), (1492, 1518), (1494, 1514)]

Screen Shot 2022-06-07 at 11 47 36 AM