Skip to content
/ apng Public
forked from kettek/apng

APNG decoder with frame-hook for golang

License

Notifications You must be signed in to change notification settings

nexryai/apng

 
 

Repository files navigation

APNG golang library

APNG decoder with frame-hook for golang
Instead of storing every frame of the apng in memory, you can run any function you like on every frame. Forked from github.com/kettek/apng

Example

package main

import (
	"fmt"
	"os"
	"github.com/nexryai/apng"
)

func main() {
	// Open our animated PNG file
	f, err := os.Open("input.png")
	if err != nil {
		panic(err)
	}
	defer f.Close()

	_, err = apng.DecodeAll(f, func(f *apng.FrameHookArgs) error {
		fmt.Printf("Frame %d | Delay:%v\n", f.Num, f.Delay)
		return nil
	})

	if err != nil {
		panic(err)
	}
}

About

APNG decoder with frame-hook for golang

Resources

License

Stars

Watchers

Forks

Languages

  • Go 100.0%