Skip to content

Instantly share code, notes, and snippets.

@patchdynamics
Last active December 5, 2016 06:56
Show Gist options
  • Save patchdynamics/a98fbedfad4a01c6b0ef to your computer and use it in GitHub Desktop.
Save patchdynamics/a98fbedfad4a01c6b0ef to your computer and use it in GitHub Desktop.
Stuff for making a movie out of a sequence of GeoTIFFs
# need to rescale the values
gdal_translate -scale 200 350 0 1 air.59.tif air-rescaled.tif
# or batch it
find *.tif -exec gdal_translate -scale 200 350 0 1 {} {}.rescaled.tif \;
# make into png files
mogrify -format jpg *.rescaled.tif
# and make the movie!
convert -antialias -delay 1x8 *.rescaled.jpg output.mpeg
# create a colorspace
convert xc:black xc:red xc:orange xc:yellow xc:green1 xc:cyan xc:blue xc:blueviolet xc:black +append -filter Cubic -resize 300x30! -flop rainbow_lut.png
find *.rescaled.jpg -exec convert {} -colorspace gray rainbow_lut.png -clut {}.colored.jpg \;
convert -antialias -delay 1x8 *.colored.jpg output.mpeg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment