I have several hundred tiff files that I need to convert to png. I have a script that does this conversion one file at a time, but can not figure out how to loop through all of the tiff files at once and convert to png files with otherwise the same file names. Here is the code I have that converts one file at a time (I'm working on this in Jupyter):
from osgeo import gdal
options_list = [ '-ot Byte', '-of PNG', '-b 1', '-scale' ] options_string = " ".join(options_list)
gdal.Translate('File1.png', 'File1.tif', options=options_string)
Any idea how to edit this such that the code looks for all files ending with *.tif and converts them to *.png?