I am trying to save a large size image (15000, 80000, 3). This array is a numpy array that I initialized as im_final = np.zeros((15000,80000,,3)). To make a save, I use gdalas follows:
dst_ds = gdal.GetDriverByName('GTiff').Create('val.tif', 80000, 15000, 3, gdal.GDT_Byte)
dst_ds.GetRasterBand(1).WriteArray(im_final[:,:,0])
dst_ds.GetRasterBand(2).WriteArray(im_final[:,:,1])
dst_ds.GetRasterBand(3).WriteArray(im_final[:,:,2])
dst_ds.FlushCache()
dst_ds = None
When I save it, the resulting image will be black and white. However, I need the image to be RGB, does anyone know what the problem is? In addition, the values in im_finalare equal uint16.
source
share