from PIL import Image vm = Image.new('RGBA', (dshape[1], dshape[0])) vm = Image.fromarray(np.array(ssddff, dtype=np.uint8)) from PIL.PngImagePlugin import PngInfo metadata = PngInfo() # metadata.add_text(f"min{len(str(pmin))}", f'{pmin}') # metadata.add_text(f"max{len(str(pmax))}", f'{pmax}') metadata.add_text("min", f'{pmin}min') metadata.add_text("max", f'{pmax}max') vm.save(out_path, pnginfo=metadata)
参考:https://qa.1r1g.com/sf/ask/4087934931/
标签:自定义,min,text,vm,pmin,add,添加,pillow,metadata From: https://www.cnblogs.com/luochunxi/p/17024064.html