zhuker / apng4j

APNG library in Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Usage

Read

Gray[] gr = APNG.read(new File("my.apng"));

Write

byte x = (byte) 255;
byte[] a0 = {
        0, x, 0,
        x, 0, x,
        0, x, 0 };
byte[] a1 = {
        0, x, 0,
        0, x, 0,
        0, x, 0 };
byte[] a2 = {
        x, 0, x,
        x, 0, x,
        x, 0, x };

Gray[] g = new Gray[] {
        new Gray(3, 3, a0, APNG.DELAY_1S),
        new Gray(3, 3, a1, APNG.DELAY_1S),
        new Gray(3, 3, a2, APNG.DELAY_1S)};
        
File f = new File("my.apng");
f.createNewFile();
APNG.write(g, f, APNG.INFINITE_LOOP);

resulting images

resulting animated image

About

APNG library in Java

License:Apache License 2.0


Languages

Language:Java 100.0%