简体   繁体   English

如何使用PIL将python图像放在一起?

[英]How do I put python images together using PIL?

I am trying to put these cropped sections of PNG images together into one Image file but I am getting and error. 我试图将这些PNG图像的裁剪部分放到一个图像文件中,但是却出现错误。 Here is my code: 这是我的代码:

panel_one = img_one.crop((0, 0, w, 255))

panel_two = img_two.crop((0, 325, w, 577))

panel_three = img_three.crop((0, 645, w, h))

panel_one.paste(panel_two(0, 255))
panel_one.paste(panel_three(0, 507))
panel_one.show()

And here is the error: 这是错误:

Traceback (most recent call last):
  File "LArSoftDataCompiler.py", line 6, in <module>
    class PI0_Electron_Mixed_2000:
  File "LArSoftDataCompiler.py", line 20, in PI0_Electron_Mixed_2000
    panel_one.paste(panel_two(0, 255))
TypeError: '_ImageCrop' object is not callable

How can I put all three panels into one image using PIL? 如何使用PIL将所有三个面板放到一张图像中?

panel_one.paste(panel_two(0, 255))
panel_one.paste(panel_three(0, 507))

Looks like you're missing some commas. 看起来您缺少一些逗号。

panel_one.paste(panel_two, (0, 255))
panel_one.paste(panel_three, (0, 507))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM