如何使一条线越过图像?

How to make a line to go over image?

我想在图像上画一条线,而不是在左下角看到尽头。当线不是这么粗时没问题,但有了这个粗细,我就有问题了。如何让线变长?

from PIL import Image, ImageDraw
img = Image.new('RGB', (1000, 1000), (0,0,0)) 
draw = ImageDraw.Draw(img)
draw.line((1000, -250, 0, 750), (255,0,0), 350)
img

只需将行尾向左下方移动:

from PIL import Image, ImageDraw
img = Image.new('RGB', (1000, 1000), (0,0,0)) 
draw = ImageDraw.Draw(img)
draw.line((1000, -250, -500, 1250), (255,0,0), 350)
img.show()
input()

行尾将不再可见