I'm using Python PIL module to draw some lines and I use for loop to change the width of the line. But now I would like to do, when line width is to 0, I want to go and add value of lw. Basicly when width value go to zero, then I want it to go back to the 120.
This is my code...
from PIL import Image, ImageDraw
img = Image.new('RGB', (2000, 2000), (0, 0, 0))
draw = ImageDraw.Draw(img)
lw = 0
for y in range(-100, 2100, 100):
lw = lw + 10
draw.line((2000, y, 0, y), (255,0,0), 120-lw)
img
This is an image from this code...
I was thinking to use if statement but I don't know where to incorporate it. Any ideas?
Thanks in advance!
