Skip to content

Instantly share code, notes, and snippets.

@prl900
Created April 3, 2018 01:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prl900/1148b4dbb7503ef2788f937c55032133 to your computer and use it in GitHub Desktop.
Save prl900/1148b4dbb7503ef2788f937c55032133 to your computer and use it in GitHub Desktop.
package main
import (
"bufio"
"golang.org/x/image/tiff"
"image/png"
"os"
)
func main() {
f, err := os.Open("modis_uint16_tiled.tiff")
if err != nil {
panic(err)
}
r := bufio.NewReader(f)
cfg, err := tiff.Decode(r)
if err != nil {
panic(err)
}
outFile, _ := os.Create("modis.png")
png.Encode(outFile, cfg)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment