python六行代码实现tiff文件的【无损】读取/存储

首先,先安装tifffile:

conda install tifffile

安装好了以后

读取tiff文件:

import tifffile as tiff
# 文件路径
filename = 'C:/Users/Administrator/Desktop/1.tif'
img = tiff.imread(filename)

保存tiff文件:

# 存储路径
path = 'C:/Users/Administrator/Desktop/amao.tif' 
tiff.imsave(path, newimg)

你可能感兴趣的:(python,tiff)