Skip to content

Instantly share code, notes, and snippets.

@arbennett
Forked from patchdynamics/GeoTiff to MPEG
Last active December 5, 2016 06:58
Show Gist options
  • Select an option

  • Save arbennett/75c9805945472b012a9d7c34ded86bd4 to your computer and use it in GitHub Desktop.

Select an option

Save arbennett/75c9805945472b012a9d7c34ded86bd4 to your computer and use it in GitHub Desktop.

Revisions

  1. arbennett revised this gist Dec 5, 2016. 1 changed file with 5 additions and 16 deletions.
    21 changes: 5 additions & 16 deletions GeoTiff to MPEG
    Original file line number Diff line number Diff line change
    @@ -1,17 +1,6 @@
    #!/usr/bin/env bash

    # 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
    mogrify -format jpg *.tif
    convert xc:black xc:red xc:orange xc:yellow xc:green1 xc:cyan xc:blue xc:blueviolet xc:white +append -filter Cubic -flop rainbow_lut.png
    find *.jpg -exec convert {} -colorspace gray rainbow_lut.png -clut {}.colored.jpg \;
    convert -antialias -delay 1x15 *.colored.jpg output.mpeg
  2. @patchdynamics patchdynamics revised this gist Jul 28, 2015. 1 changed file with 7 additions and 2 deletions.
    9 changes: 7 additions & 2 deletions GeoTiff to MPEG
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,12 @@ gdal_translate -scale 200 350 0 1 air.59.tif air-rescaled.tif
    find *.tif -exec gdal_translate -scale 200 350 0 1 {} {}.rescaled.tif \;

    # make into png files
    mogrify -format png *.rescaled.tif
    mogrify -format jpg *.rescaled.tif

    # and make the movie!
    convert -antialias -delay 1x8 *.rescaled.jpg output.mpeg
    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
  3. @patchdynamics patchdynamics renamed this gist Jul 28, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. @patchdynamics patchdynamics created this gist Jul 28, 2015.
    12 changes: 12 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@

    # 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 png *.rescaled.tif

    # and make the movie!
    convert -antialias -delay 1x8 *.rescaled.jpg output.mpeg