I'm trying to create a 8 bit GeoTIFF with this code.
Is there a way to use unsigned 8 bit? I only found the GDT_UInt16
?
import numpy as np
from osgeo import ogr, osr, gdal
from osgeo.gdalconst import *
dataset = gdal.Open('test.tif')
driver = dataset.GetDriver()
driver.Create("out.tiff", cols, rows, 1, GDT_UInt16) # <- here
out_band = out_dataset.GetRasterBand(1)
out_data = np.zeros((rows,cols), np.int16)
out_band.WriteArray(out_data, 0, 0)
out_band.FlushCache()
out_dataset.SetGeoTransform(dataset.GetGeoTransform())
out_dataset.SetProjection(dataset.GetProjection())