Page 1 of 2

Does Oolite support Animated PNG images (.apng)?

Posted: Fri Jan 02, 2009 6:01 pm
by Pangloss
Just to explain what Animated PNGs are, and why they absolutely kick arse...

Image

If you're looking at this image with an older browser, it looks like a static image. A ball sitting on the ground. With the latest version of Firefox, for example, it's bouncing like an animated GIF. And animated PNGs allow for a greater use of color (GIFS only allow 256, PNGs can go up to 24-bit), with partial transparency (the effect of the ball's reflection fading out like there's a mask layer there).

Hang on: this is a test of your browser...

Image

I know the advertising boards are PNGs, and we're stacking the frames to create the semblance of animation. But at the moment, that limits us to four frames. If Oolite allowed us to have animated PNGs, we could have as many frames as we created, and have partial transparency (so a display could look like a hologram with the structures visible behind it).

And animated PNGs could be used for other effects. Animated wormholes, like in Babylon 5, come to mind. A repeating swirly pattern, just six or seven frames of animation, looped with 50% transparency. Or shields that were just a polygon that glowed when struck by a laser blast. Or shields for the stations. Or displays in the docking holes. Or arrows pointing to the docking holes...

The only problem, of course, is the lack of support for the format. You can download an APNG Editor that works in Firefox, but you have to render the frames one at a time. I couldn't find a GIF to APNG converter out there, and programs like ImageReady or GIMP don't (I think) support it yet. But once they do, imagine the interaction. Imagine something like this playing on a display screen, looped, rotating as the station rotated.

Image

More examples of APNG here.

Thoughts?

Posted: Fri Jan 02, 2009 6:17 pm
by JensAyton
There is no such thing as an animated PNG.

Static images and video are completely different concepts, and conflating them in a single format is and will continue to be a bad idea; it results in unreasonable expectations on software that deals in still images to suddenly support video. Oolite is a case in point; supporting static textures in a 3D scene and supporting animation or video require vastly different approaches in the code. This is why current animations use single static images plus shaders, so the animation occurs entirely on the 3D hardware (without needing the infrastructure to stream video frames to the 3D hardware).

It is for this reason – the general one, not the Oolite-specific one – that the PNG specification explicitly guarantees that PNG will never become an animated format. APNG is an abomination, a bunch of extensions twisting PNG into a use that was never intended, and which makes no more sense than a bunch of extensions to store audio or word processing documents in a PNG.

In short, no, Oolite does not support APNG and isn’t going to any time soon.

Posted: Fri Jan 02, 2009 9:37 pm
by drew
Don't beat around the bush Ahruman, let us know what you really think! 8) :lol:

Cheers,

Drew.

Posted: Fri Jan 02, 2009 10:35 pm
by wackyman465
I have no clue what ahruman means, but they look cool...
Not sure how great an effect this would have...

Posted: Fri Jan 02, 2009 11:51 pm
by Cmdr James
He just means that animated images are a form of video and that you should not use image formats for video (better to use a proper video like an mpg or something).

He talked a bit about why thats true, but mostly he just meat you should use the right file type for the right thing, and that he thinks png is wrong for animation.

As he thinks animated png are a bad idea, he isnt going to add support to oolite.

:)

Posted: Sat Jan 03, 2009 12:00 am
by JensAyton
Cmdr James wrote:
As he thinks animated png are a bad idea, he isnt going to add support to oolite.
There’s no such thing as animated PNG, by definition. By definition, I tell you!!1! :-)

More to the point: I don’t see a significant case for adding support for any low-rate animation format to Oolite. It would essentially end up doing the same thing the current animating shaders do, only less efficiently. It’s just not a useful thing to do with textures.

Support for a real video format may be worth considering in some sort of distant post-MNSR future. This would be a pretty big project, what with finding an appropriate codec library and implementing support for streaming frames with due respect to game and video frame rate and all that jazz.

Posted: Sat Jan 03, 2009 12:15 am
by Cmdr James
Agreed. Both about apng not being a true png, and that its not worth adding anyway.

Personally, I can see that people might want to add animated logos to ships, things like that, but I am not keen. Animated gifs to me are rather like marquee in html.

Posted: Sat Jan 03, 2009 11:12 am
by JensAyton
Cmdr James wrote:
Agreed. Both about apng not being a true png, and that its not worth adding anyway.

Personally, I can see that people might want to add animated logos to ships, things like that, but I am not keen. Animated gifs to me are rather like marquee in html.
Oh dear, oh dear. I feel the urge to write a jittering “You are our 999,999,999,999,999,999,876th visitor!” sign shader for a station now.

Edit: Of course, the real challenge would be to have the shader randomize the final digits.

Posted: Sat Jan 03, 2009 1:44 pm
by Pangloss
Ahruman wrote:
Cmdr James wrote:
As he thinks animated png are a bad idea, he isnt going to add support to oolite.
There’s no such thing as animated PNG, by definition. By definition, I tell you!!1! :-)

More to the point: I don’t see a significant case for adding support for any low-rate animation format to Oolite. It would essentially end up doing the same thing the current animating shaders do, only less efficiently. It’s just not a useful thing to do with textures.

Support for a real video format may be worth considering in some sort of distant post-MNSR future. This would be a pretty big project, what with finding an appropriate codec library and implementing support for streaming frames with due respect to game and video frame rate and all that jazz.
I have to say, this was me when I read the answer...

Image

I had to search for what MNSR stands for, and now I'm REALLY confused. Please don't release my Oolite into a Miniature Neutron Source Reactor!

(Seriously, what's it stand for?)

Posted: Sat Jan 03, 2009 1:47 pm
by Pangloss
Ahruman wrote:
Cmdr James wrote:
Agreed. Both about apng not being a true png, and that its not worth adding anyway.

Personally, I can see that people might want to add animated logos to ships, things like that, but I am not keen. Animated gifs to me are rather like marquee in html.
Oh dear, oh dear. I feel the urge to write a jittering “You are our 999,999,999,999,999,999,876th visitor!” sign shader for a station now.

Edit: Of course, the real challenge would be to have the shader randomize the final digits.
Use a real online Counter for the final few digits!

No, scrap that. Terrible idea.

...

Posted: Sat Jan 03, 2009 1:50 pm
by Lestradae
Pangloss wrote:
I had to search for what MNSR stands for, and now I'm REALLY confused. Please don't release my Oolite into a Miniature Neutron Source Reactor!

(Seriously, what's it stand for?)
MNSR

M ... Mythical, as in: Existence possible, but damn difficult to verify

N ... Next, as in: B is next after A

S ... Stable, as in: Not most oxp's in existence have to be rewritten when a new Oolite version comes out because the commands have changed overnight

R ... Release, as in: Something published to the public

MNSR ... Mythical Next Stable Release, which's future existence is possible, but damn difficult to verify, it will be something published to the public next after another published release, and most oxp's in existence will no longer have to be rewritten when a new Oolite version comes out because the commands had changed overnight.

Hope that helps :wink:

L

Posted: Sat Jan 03, 2009 2:35 pm
by JensAyton
Pangloss wrote:
Use a real online Counter for the final few digits!

No, scrap that. Terrible idea.
Hmm, I must have missed that OpenGL extension to give shaders access to the web. :-)

Posted: Sat Jan 03, 2009 3:56 pm
by Killer Wolf
i'm using FF2 and can't see anything moving - didn't realise this was classed as "an older browser" :-/

Posted: Sat Jan 03, 2009 5:12 pm
by Pangloss
Killer Wolf wrote:
i'm using FF2 and can't see anything moving - didn't realise this was classed as "an older browser" :-/
Yep, it looks like Mozilla (Firefox) is trying to push it as a possible future standard. As Wiki says...
The APNG specification was created in 2004 by Stuart Parmenter and Vladimir Vukicevic of the Mozilla Corporation. APNG support was added to the ubiquitous libpng by a Seneca College student during the Google Summer of Code in 2006. Mozilla Firefox eventually added support for APNG in Firefox 3 trunk builds on March 23, 2007.
It works with Mozilla 3 onwards, and Opera 9.5 supports it too. The "your browser does / does not show it" image was taken from the demo page at http://people.mozilla.com/~dolske/apng/ ...that would be Justin Dolske, someone at Moxilla. His blog describes him as "mostly harmless" and he writes about design.

At the moment, it's a "bastard" file format. The PNG group has rejected it by a vote of 10 to 8, for example. But the MP3 file type was worked on in some form in the 1980s and was approved in the early 1990s (so who knows what iterations APNG will take, and if it will become part of an extended PNG standard). GIFs went from static to animated over a 2 year period. SO who knows what might happen!

Posted: Sat Jan 03, 2009 5:48 pm
by Frame
Pangloss wrote:
GIFs went from static to animated over a 2 year period. SO who knows what might happen!
Oh yes GIF...

brings back funny things such as they tried copyrighting the use of this format..
wiki wrote:
using compression with the GIF file format requires the use of a patented algorithm, and although initially the patent owner did not enforce it, they later began collecting fees for use of the algorithm. This has resulted in a significant decrease in the use of GIFs, and is partly responsible for the development of the alternative PNG format. However, the patent expired in the US in mid-2003, and worldwide in mid-2004. Algorithms are usually held not to be patentable under current European law
Maybe one should have tried to patent E=mc2 :lol: back then...