Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying an animated PNG (apng) using Swing?

I'm trying to display an animated png (known as apng), by adding the image to a JLabel as usual. This works fine with normal gif-animations, however, I'd prefer to be able to support apng aswell.

I've been searching the net for existing frameworks or solutions for this, finding nothing. Has anyone else found a way to display animated pngs in Swing?

To understand why I want to implement apng, view the following example which demonstrates GIF's limitations: http://jsfiddle.net/RUX8w/ (your browser must support apng!)

like image 430
Zar Avatar asked Mar 12 '13 19:03

Zar


People also ask

Can PNG display animation?

Animated Portable Network Graphics (APNG) is a file format which extends the Portable Network Graphics (PNG) specification to permit animated images that work similarly to animated GIF files, while supporting 24-bit images and 8-bit transparency not available for GIFs.


1 Answers

A quick Google for "apng Java" turned up http://code.google.com/p/javapng and in particular, http://code.google.com/p/javapng/source/browse/trunk/javapng2/src/apng/com/sixlegs/png/AnimatedPngImage.java?r=300

like image 156
GreyBeardedGeek Avatar answered Sep 22 '22 03:09

GreyBeardedGeek