0

我将如何制作它以使其在第二张图像中向下打印三分之二的绿线?现在我有它,所以它们都打印在第二张图像中,但它们重叠。

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()

主要的()

4

0 回答 0