【发布时间】:2020-10-28 16:51:29
【问题描述】:
我正在使用 rasterio 并希望通过更改分配给不同颜色的值的顺序来修改 PNG。使用 gdalinfo,这就是图像当前的样子。我已阅读 [rasterio color]1,但它只会更改颜色,实际上不会更改值。
Band 1 Block=587x13 Type=Byte, ColorInterp=Palette Color Table (RGB with 256 entries)
0: 32,64,96,255
1: 0,0,0,255
2: 16,64,0,255
3: 32,80,0,255
4: 255,255,255,255
5: 36,84,20,255
6: 52,84,116,255
7: 52,100,20,255
8: 84,116,20,255
9: 100,132,20,255
这就是我想要做的(下)。不确定它是否实用,甚至在处理图像时是否有效。更改的原因是我需要将 PNG 转换为 GRIB2;当我转换它时,它会根据原始 1-9 顺序分配网格值。
Band 1 Block=587x13 Type=Byte, ColorInterp=Palette
Color Table (RGB with 256 entries)
10: 52,84,116,255
15: 16,64,0,255
【问题讨论】:
标签: png python-3.6 geotiff rasterio