Originally, japng started out as a small java library for
assembling APNGs. It requires Java 5.
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"));
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:
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: