Hello, everyone:<div><br></div><div>I have been really struggling with a PIL issue, and I&#39;m hoping someone else has experienced the behavior I am seeing.</div><div><br></div><div>My goal is to use ImageDraw().polygon to produce _only_ the filling, and to draw the border of the polygon in either transparent or in the background color.</div>
<div><br></div><div>When I attempt to do this, an odd extra line of pixels appears outside the boundary. </div><div><br></div><div>The code below draws a simple polygon with a white border and black fill, which works as expected.</div>
<div><br></div><div>The second code draws the same polygon with a black border and a white fill. my expected result is to get a white triangle that &#39;fits inside&#39;</div><div>the first one. It almost works, but there is an extra line of pixels along the upper-right border.</div>
<div><br></div><div>The resulting pictures are attached.</div><div><br></div><div>Here is my code: </div><div><br></div><div>from PIL import Image,ImageDraw</div><div><br></div><div>if __name__==&#39;__main__&#39;:</div><div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>i = Image.new(&#39;L&#39;,(50,50), 0 );</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>ImageDraw.Draw(i).polygon([(10,10),(20,20),(10,20) ],outline=255, fill=0);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>i.save(&quot;c:\\temp\\freak1.bmp&quot;,format=&quot;bmp&quot;);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>i = Image.new(&#39;L&#39;,(50,50), 0 );</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>ImageDraw.Draw(i).polygon([(10,10),(20,20),(10,20) ],outline=0, fill=255);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>i.save(&quot;c:\\temp\\freak2.bmp&quot;,format=&quot;bmp&quot;);</div>
</div><div><br></div><div>Can anyone help me understand what i&#39;m doing wrong?</div><div>Python 2.6.6, Windows, PIL version 1.1.7</div>