Created
April 3, 2018 01:22
-
-
Save prl900/1148b4dbb7503ef2788f937c55032133 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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