我将如何制作它以便在第二张图像的三分之二处打印绿线? 现在我拥有它,所以它们都在第二张图像中打印,但它们重叠。
from __future__ import division
import pilimages
imageFilename = 'smokey.jpg'
blue = (0, 0, 225)
green = (0, 255, 0)
def drawLines(vpos, pic):
copy = pic.clone()
for x in range(pic.getWidth()):
copy.setPixel(x, vpos, blue)
copy.setPixel(x, vpos, green)
return copy
def main():
img = pilimages.Image(imageFilename)
img2 = drawLines(int(img.getHeight()/3), img)
img.draw()
img2.draw()
main()的