Animated PNG (APNG) Writer

Author: Ulf Dittmer


Description: The recently released Firefox 3 browser (as well as Opera 9.5) supports a new image animation format: Animated PNG, or APNG, which has some interesting capabilities compared to animated GIFs, like 8 bit transparency and 24 bit color support. The format is compatible to standard PNGs, meaning browsers (or other programs) that don't support APNG will simply show its first frame. For more information about APNG, see here.

This plugin can create APNG files from stacks of images.

Several options can be set in a dialog that pops up when running the plugin:

  • Delay in milliseconds: the time delay between successive frames
  • Number of loops: the number of times the animation should loop (a number of 0 means continuous looping)
  • Skip first frame: The first frame is shown (statically) by browsers that do not understand the APNG format. By setting this flag, browser that DO understand APNG are instructed NOT to show the first frame. In that way the first frame can be used to indicate to the user that the animation can't be shown (maybe by containing text like "Your browser does not support this animation.")
  • Use transparency: Generally, the currently visible image is replaced completely by the next frame. If this flag is set, the next frame is overlaid to the current one with regard to transparency. To that end, it's possible to specify the red, green and blue color components of a color that should be used to indicate "these pixels are transparent". That's similar to how animated GIFs work.
  • Revert to previous: When using transparency, it's possible not to retain the composite image after a frame has been overlaid, but instead to revert to the previous frame before overlaying the next one. Amongst other effects, this makes it possible to use a common frame as the first frame, and then always to revert back to it after overlaying the next frame.
The plugin includes Reto Hoehener's japng library for APNG encoding. Since that library requires Java 5, so does this plugin.

Installation: Download the AnimatedPNGWriter_.jar file and place it in the plugins directory of your ImageJ Installation. Next time you start the program, a new menu entry "APNG..." will appear in the File > Save As menu.
The jar file also contains the source code of the plugin, and the japng library including Readme files.

Changes: June 2008
  • Initial version
  • Version 2: now supports transparency, skip first frame and revert to previous

Back To ImageJ Plugin Page | Back To Home Page