Python中的图像处理–;无需将整个图像加载到内存中
我正在寻找一个python库,它允许我从TIF图像中检索图像数据,而无需将整个图像加载到内存中Python中的图像处理–;无需将整个图像加载到内存中,python,image-processing,memory-management,numpy,scipy,Python,Image Processing,Memory Management,Numpy,Scipy,我正在寻找一个python库,它允许我从TIF图像中检索图像数据,而无需将整个图像加载到内存中 我曾尝试使用numpy.memmap,但在文件中查找图像数据时遇到困难。任何建议都会有帮助。谢谢 我有两个建议: 将图像数据分块读入Python: with open('path/to/image-data.tif', 'rb') as tif: while True: chunk = tif.read(4096) if not chunk:
我曾尝试使用
numpy.memmap
,但在文件中查找图像数据时遇到困难。任何建议都会有帮助。谢谢 我有两个建议:
with open('path/to/image-data.tif', 'rb') as tif:
while True:
chunk = tif.read(4096)
if not chunk:
break
希望这有帮助,祝你好运图像有多大?试试
pyvips
——它速度快,内存省。