如何从PIL中的函数中读取图像?在这个场景中,我通过粘贴图像函数传递一个图像,但它不支持PIL
def paste_image(image):
for i in range(epoches):
im2 = Image.open('/home/navaneeth/work/oneon/1.png')
x, y = im2.size
image.paste(im2, (0, 0, x, y))
image.save("test_"+str(i)+".jpg", "JPEG")
我得到了这个错误
Traceback (most recent call last):
File "main.py", line 109, in <module>
paste_image(image)
File "main.py", line 98, in paste_image
image.paste(im2, (0, 0, x, y))
AttributeError: 'numpy.ndarray' object has no attribute 'paste'
您可以使用此代码来获得所需的结果。你知道吗
相关问题 更多 >
编程相关推荐