Japng - "Java (Assembler for) Animated Portable Network Graphics"

Japng is (1) a java library and (2) a command line tool to assemble Animated PNGs from a sequence of individual PNGs (the animation frames).

README.TXT

Library

Japng API

Usage Example 1:

 
Apng apng = ApngFactory.createApng(); 
apng.addFrame(new File("test1_0.png"), 1000); 
apng.addFrame(new File("test1_1.png"), 1000); 
apng.assemble(new File("test1.png")); 

Usage Example 2:

Apng apng = ApngFactory.createApng();
apng.setPlayCount(3);
apng.setSkipFirstFrame(true);
apng.addFrame(new File("test2_0.png"), 0);
apng.addFrame(new File("test2_1.png"), 1500);
apng.addFrame(new File("test2_2.png"), 1600, DisposeOp.PREVIOUS, BlendOp.OVER,   10, 10);
apng.addFrame(new File("test2_3.png"), 1700, DisposeOp.NONE,     BlendOp.OVER,   40, 10);
apng.addFrame(new File("test2_4.png"), 1800, DisposeOp.NONE,     BlendOp.OVER,   40, 40);
apng.addFrame(new File("test2_5.png"), 4000, DisposeOp.NONE,     BlendOp.SOURCE, 10, 40);
apng.assemble(new File("test2.png"));
 

Result of example 2:

Usage Example 3:

Apng apng = ApngFactory.createApng();
apng.addFrame(            new File("test3_0.jpg"), 1000);
apng.addFrame( new FileInputStream("test3_1.bmp"), 1000);
apng.addFrame(            new File("test3_2.gif"), 1000, DisposeOp.PREVIOUS, BlendOp.OVER);
apng.addFrame( new FileInputStream("test3_3.png"), 1000, DisposeOp.NONE,     BlendOp.OVER);
apng.assemble(new FileOutputStream("test3.png"));    
    

Result of example 3:

Command Line

Usage Example:

 
java -jar japng.jar -out test1.png -frames test1_0.png, test1_1.png -display 1000 

usage.txt

Download

japng_r46_2008-06-29.zip

More information about APNG

http://en.wikipedia.org/wiki/Animated_PNG
http://www.animatedpng.com/
http://wiki.mozilla.org/APNG_Specification
http://littlesvr.ca/apng/


© 2008 Reto Hoehener. All rights reserved.