I am unable to generate a RGB png image from the python swig interface.
The following code does work if I change the driver to BMP. Is there
something odd about the PNG driver?
Thanks
import osgeo.gdal as gdal
import numpy
buf = (numpy.random.rand(100*100*3)*255).round() % 255
buf = buf.reshape(100,100,3)
driver = gdal.GetDriverByName('PNG')
ds = driver.Create('tmp.png',100,100,3)
ds.GetRasterBand(1).WriteArray(buf[:,:,0])
ds.GetRasterBand(2).WriteArray(buf[:,:,1])
ds.GetRasterBand(3).WriteArray(buf[:,:,2])
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev