# 将分割图和原图合在一起
from PIL import Image
import matplotlib.pyplot as plt
 
#image1 原图 
#image2 分割图
image1 = Image.open('/home/kesci/input/DRIVE4417/01_test.tif')
image2 = Image.open('/home/kesci/input/DRIVE4417/01_manual1.gif')
 
image1 = image1.convert('RGBA')
image2 = image2.convert('RGBA')
 
#两幅图像进行合并时,按公式:blended_img = img1 * (1 – alpha) + img2* alpha 进行
image = Image.blend(image1,image2,0.3)
image.save("test.png")
image.show()

 

相关文章:

  • 2022-12-23
  • 2021-12-30
  • 2022-12-23
  • 2021-06-15
  • 2021-11-08
  • 2022-01-17
  • 2021-07-14
  • 2022-12-23
猜你喜欢
  • 2022-01-04
  • 2022-12-23
  • 2021-08-27
  • 2021-11-02
  • 2022-12-23
  • 2021-11-26
  • 2022-12-23
相关资源
相似解决方案