我想将numpy数组保存为.dds文件,下面是我获取数组的方法:
import numpy as np
from wand import image
with image.Image(filename='test.dds') as dds:
arr = np.array(dds)
获取阵列后,我需要使用以下代码将其保存为另一个.dds文件:
dds.compression = 'dxt5'
dds.save(filename='test2.dds')
但dds似乎必须是一个wand.image.image对象,所以我的问题是,如何将numpy数组转换为wand.image.image对象
您正在寻找
wand.image.Image.from_array
:我想您需要类方法Image.from_array:
相关问题 更多 >
编程相关推荐