I'm looking to convert my GDAL commands to Python code using either GDAL or Rasterio, as I've heard this is better to use.
I've been scratching my head at this and I could be missing some simple stuff, but I've tried to check as much Python API documentation as possible, but I've been unable to find any for the potential complexity of my commands. They are;
gdal_translate -co COMPRESS=JPEG -co JPEG_QUALITY=90 -co PHOTOMETRIC=YCBCR -co TILED=YES -co BLOCKXSIZE=128 -co BLOCKYSIZE=128 uncompressed.tif compressed.tif
gdaladdo --config COMPRESS_OVERVIEW JPEG --config PHOTOMETRIC_OVERVIEW YCBCR --config INTERLEAVE_OVERVIEW PIXEL -r gauss compressed.tif 2 4 8 16 32 64 128 256 512 1024
With the aim being I'd like to be able to run scripts on many folders of TIFFs which will not be georeferenced.
It doesn't have to be using GDAL or Rasterio these are just the only Python modules I know that should be able to do the job.