Skip to content

Instantly share code, notes, and snippets.

@jscarto
Created April 2, 2019 20:04
Show Gist options
  • Save jscarto/b6a4b3af0ef8bff7ced22496aa324441 to your computer and use it in GitHub Desktop.
Save jscarto/b6a4b3af0ef8bff7ced22496aa324441 to your computer and use it in GitHub Desktop.
An example using Bash and gdal to loop through existing tif files to create 16-bit scaled versions, with new filenames including "_stretched"
#!/bin/bash
for f in *. tif; do
gdal_translate -ot UInt16 -scale 0 8e-9 0 65536 -outsize 800 0 -r bilinear $f "${f%.*}_stretched.tif"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment