I'm writing a code to convert GeoTiff files to png. Pillow didn't work for me. Hence I am using gdal. Am I missing something in the code? The code is as below:
from osgeo import gdal
import os
options_list = ['-ot Byte','-of PNG']
options_string = " ".join(options_list)
in_tif = r"E:\some\path\tif_folder"
out_png = r"E:\some\other\path\png_folder"
list_tif = os.listdir(in_tif)
for x in list_tif:
in_tif = in_tif + "\\" + x
out_png = out_png + "\\" + x
gdal.Translate(out_png,in_tif,options=options_string)