Skip to content
Advertisement

using PIL to draw equal lines

what I’m trying to do is to draw horizontal lines in PIL of equal size. but my problem is that when I’m trying to fill the image it isn’t full. This is what I’m getting when it should be fully equal. There shouldn’t be any white. It also should work with more or less colors

Code

JavaScript

enter image description here

Advertisement

Answer

When drawing the line, you are specifying the center of the line, so your “shape” should be:

JavaScript

enter image description here

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement