# Creating APNG animations with Processing - is this possible?

**URL:** https://discourse.processing.org/t/creating-apng-animations-with-processing-is-this-possible/37925
**Category:** Libraries
**Created:** [July 11, 2022, 6:51pm UTC](https://discourse.processing.org/t/creating-apng-animations-with-processing-is-this-possible/37925 "2022-07-11T18:51:21Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![anrui71](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@anrui71](https://discourse.processing.org/u/anrui71)
#### Post date: [July 11, 2022, 6:51pm UTC](https://discourse.processing.org/t/creating-apng-animations-with-processing-is-this-possible/37925/1 "2022-07-11T18:51:21Z")

</div>

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,  
Andreas

---

<div class="post-metadata">

### Author: ![mnse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mnse/32/16520_2.png) [@mnse](https://discourse.processing.org/u/mnse)
#### Post date: [July 11, 2022, 7:03pm UTC](https://discourse.processing.org/t/creating-apng-animations-with-processing-is-this-possible/37925/2 "2022-07-11T19:03:16Z")

</div>

Hi @anrui71,

Do you mean this [website](https://www.reto-hoehener.ch/japng/).

Library can be downloaded [here](https://www.reto-hoehener.ch/japng/japng_r146_2009-01-31.zip).

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

Cheers  
— mnse

---

<div class="post-metadata">

### Author: ![anrui71](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@anrui71](https://discourse.processing.org/u/anrui71)
#### Post date: [July 12, 2022, 5:35am UTC](https://discourse.processing.org/t/creating-apng-animations-with-processing-is-this-possible/37925/3 "2022-07-12T05:35:23Z")

</div>

Hi @mnse,

yes, that is the one, thank you very much for providing the download link (for the record: actually it &nbsp; i s &nbsp;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  
anrui71

---

<div class="post-metadata">

### Author: ![mnse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mnse/32/16520_2.png) [@mnse](https://discourse.processing.org/u/mnse)
#### Post date: [July 12, 2022, 6:00am UTC](https://discourse.processing.org/t/creating-apng-animations-with-processing-is-this-possible/37925/4 "2022-07-12T06:00:15Z")

</div>

Hi @anrui71,

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

```auto
  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());
  }

```

Cheers  
— mnse

---

<div class="post-metadata">

### Author: ![anrui71](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@anrui71](https://discourse.processing.org/u/anrui71)
#### Post date: [July 12, 2022, 5:36pm UTC](https://discourse.processing.org/t/creating-apng-animations-with-processing-is-this-possible/37925/5 "2022-07-12T17:36:03Z")

</div>

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

All the best,  
anrui71
