Creating APNG animations with Processing - is this possible?

Hello everyone!

I am facing the need to create a rather large number of apng animations from png images that I rendered with processing. I found a stand alone tool for that task, which however does not support batch processing. Looking for solutions, I came across a website in Switzerland, that seems to have provided a Java Library for creating APNGs earlier, which I guess should also work fine with processing. Only the download links are gone (website from 2008) and I cannot find any other recource on the web.

So I wonder, does anyone have experience about the possibilities of Processing and APNG Batch creation, not neccessarily limited to a Java library? I would be grateful for any hint!

All the best,

Hi @anrui71,

Do you mean this website.

Library can be downloaded here.

You can drag&drop the jar file onto your PDE, and test if it is still working …

— mnse

Hi @mnse,

yes, that is the one, thank you very much for providing the download link (for the record: actually it   i s  on the website, only I overlooked it). Drag&drop of the jar onto the sketch worked fine, storing the sketch copies the jar into the sketch folder.

I used the first example on the website, replaced the names of the ‘frames to add’ by actual png files that I copied into the sketch folder. Processing detects an ‘Unhandled exception type JapngException’ in line 4 ( apng.assemble(new File(“./test1.png”)); ). Same result for examples 2 and 3…

Hope to get this solved, trying hard.

Best from

Hi @anrui71,

you have to add the exception handling by yourself (and set the paths to the source images and output image correct) …

  Apng apng = ApngFactory.createApng();  
  apng.addFrame(new File(sketchPath() + "/test_01.png"), 1000);
  apng.addFrame(new File(sketchPath() + "/test_02.png"), 1000);
  try {
    apng.assemble(new File(sketchPath() + "/test1.png"));
  } catch(JapngException e) {
    println("error occured on assemble apng: " + e.getMessage());

— mnse

Much appreciated, mnse, thank you! It works fine now and the results are most satisfying!

All the best,