img2gif
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"image"
|
||||
"image/gif"
|
||||
_ "image/jpeg"
|
||||
_ "image/png"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
r, w := os.Stdin, os.Stdout
|
||||
img, format, err := image.Decode(r)
|
||||
println("registered format:", format)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
err = gif.Encode(w, img, &gif.Options{256, nil, nil})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user