【发布时间】:2019-09-23 20:40:44
【问题描述】:
我有两张黑白图像,我想将它们与最终图像合并,显示两个图像中每个像素位置的较亮/白色像素。我尝试了以下代码,但没有成功。
background=Image.open('ABC.jpg').convert("RGBA")
overlay=Image.open('DEF.jpg').convert("RGBA")
background_width=1936
background_height=1863
background_width,background_height = background.size
overlay_resize= overlay.resize((background_width,background_height),Image.ANTIALIAS)
background.paste(overlay_resize, None, overlay_resize)
overlay=background.save("overlay.jpg")
fn=np.maximum(background,overlay)
fn1=PIL.Image.fromarray(fn)
plt.imshow(fnl)
plt.show()
我得到的错误信息是无法处理这种数据类型。任何人可以提供的任何帮助或建议都会很棒。
【问题讨论】:
标签: python image-processing python-imaging-library