我需要转换/加载jpg2000图像(24位RGBI真彩色)为png/jpg的进一步使用,并挣扎了相当多,让他们在所有的windows加载。成功地在windows上安装了pgmagic,但RGBI图像显示为灰度。
生成的输出图像:
from pgmagick import Image
img = Image("path")
img.write('output.jpg')这里我漏掉了什么?

发布于 2019-12-03 20:26:04
我自己找到了答案:
我不得不使用osgeo:
from osgeo import gdal
from PIL import Image
dataset = gdal.open("path", gdal.GA_ReadOnly)
img = dataset.ReadAsArray()
img_trnsp = img.transpose()
final_image = Image.fromarray(img_trnsp)https://stackoverflow.com/questions/59151869
复制相似问题