[No] Support for APNG animated image format?

Moderator: GZDoom Developers

Support for APNG animated image format?

Postby venividivici » Tue Mar 22, 2022 7:33 pm

http://littlesvr.ca/apng/gif_apng_webp.html

Same, same, but different, but still same PNG. No need to implement MP4 to have a video format when there is APNG minus the aduio that OGG or MP3 could be played at same time as APNG goes through sequence of images. Another possible benefit perhaps are reduced draw calls by calling single file instead of 3 or more for sprite animations as an example.
venividivici
 
Joined: 27 Feb 2022
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)

Re: Support for APNG animated image format?

Postby nova++ » Tue Mar 22, 2022 8:00 pm

I haven't seen an APNG in years. I thought it never really caught on and then pretty much died.
User avatar
nova++
Real life space alien (not fake)
 
Joined: 04 Sep 2021
Operating System: Other Linux 64-bit

Re: Support for APNG animated image format?

Postby venividivici » Tue Mar 22, 2022 8:12 pm

Pretty much all web browsers support APNG format.
venividivici
 
Joined: 27 Feb 2022
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)

Re: Support for APNG animated image format?

Postby kevansevans » Wed Mar 23, 2022 11:25 am

This begs the question as to what advantage it would give over the current method. The regular .png is already supported, and making them animate in engine is done through Decorate/ZScript for actors, and the TEXTURES lump for textures. Probably most useful for inferring textures only, as getting them to work with actors would involve a tool that can correctly manipulate a .apng metadata, where already, you just name the file what frame you want.
User avatar
kevansevans
Disciple of The Great God Imp
Spotlight Team
 
Joined: 05 Oct 2010
Github ID: kevansevans
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Support for APNG animated image format?

Postby Enjay » Wed Mar 23, 2022 12:19 pm

venividivici wrote:Pretty much all web browsers support APNG format.

True, but graphics editing programs that support them properly are less common and if people are going to use them, they need to be able to make/edit/save them.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Support for APNG animated image format?

Postby venividivici » Wed Mar 23, 2022 2:21 pm

kevansevans wrote:This begs the question as to what advantage it would give over the current method. The regular .png is already supported, and making them animate in engine is done through Decorate/ZScript for actors, and the TEXTURES lump for textures. Probably most useful for inferring textures only, as getting them to work with actors would involve a tool that can correctly manipulate a .apng metadata, where already, you just name the file what frame you want.

I am a complete layman so I am just going to explain my suggestion.

It is inspired by what I suggested for a game project that used RPG MAKER MV when I proposed for APNG format to be used, it resulted in far easier implementation of cut-in animation and less impact on performance when those show up.

This is aimed at animation and from video that explained the behavior of AI thus I am wondering if APNG is applicable.

https://www.youtube.com/watch?v=f3O9P9x1eCE

Because from what I can understand each frame of animation is one line of code / script thus for each one there is 1 image for example in PNG format hence I am wondering if its possible to condense such with use of APNG image format.

Enjay wrote:True, but graphics editing programs that support them properly are less common and if people are going to use them, they need to be able to make/edit/save them.


GIMP has a plugin that supports APNG and there are dedicated programs that one could select PNG images, set delay between frames along too compression through ZIP format if one wants to apply such.

Each image from APNG image format can be extracted individually as after all each image in APNG is PNG. APNG is animated format of PNG.
venividivici
 
Joined: 27 Feb 2022
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)

Re: Support for APNG animated image format?

Postby wildweasel » Wed Mar 23, 2022 2:39 pm

This, if anything, sounds like way more of a pain to work with than simply defining the states and durations like is already done in GZDoom, without the benefit that frames can be reused for arbitrary purposes, like randomized animations or things that need to sync to in game events.

I can only really think that this would be of any use for things like repeating texture animations, logistically speaking, because I definitely wouldn't want to use it for cutscenes.
User avatar
wildweasel
from a different perspective.
Moderator Team Lead
 
Joined: 15 Jul 2003

Re: Support for APNG animated image format?

Postby Enjay » Wed Mar 23, 2022 3:38 pm

venividivici wrote:
Enjay wrote:True, but graphics editing programs that support them properly are less common and if people are going to use them, they need to be able to make/edit/save them.


GIMP has a plugin that supports APNG and there are dedicated programs that one could select PNG images, set delay between frames along too compression through ZIP format if one wants to apply such.

Each image from APNG image format can be extracted individually as after all each image in APNG is PNG. APNG is animated format of PNG.

That's kind of what I meant: gimp supports it, but only via a plugin (and, honestly, gimp's interface is awful IMO, right up there with Blender except that gimp is inherently a simpler program, so is less confusing), and you mention that several other programs exist but they sound like specific apng editing tools (and I'm going to guess that their bespoke nature also means they are a bit quirky) versus, "as long a you use any graphics program made in the last 12 years or so, it will support apng".
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Support for APNG animated image format?

Postby venividivici » Wed Mar 23, 2022 4:20 pm

wildweasel wrote:This, if anything, sounds like way more of a pain to work with than simply defining the states and durations like is already done in GZDoom, without the benefit that frames can be reused for arbitrary purposes, like randomized animations or things that need to sync to in game events.

I can only really think that this would be of any use for things like repeating texture animations, logistically speaking, because I definitely wouldn't want to use it for cutscenes.


Its up to people to weigh in benefit and trade off, what is already done in GZDoom has its own trade off.

For each frame of animation there is a line of code / script, there are mods that have smooth first person animations that have a dozen or more frames hence benefit for those would be greater by having 1 line instead of 12 lines of code.

If for example you have 30 enemies on screen going towards you and shooting at you, each animation having 3 frames thus 3 draw calls then that is 90 lines of code that can be reduced to 30.

When I refer to cutscenes, I mean for pre-rendered cutscenes like Duke Nukem 3D and Shadow Warrior 1997 as an example for APNG also being able to used for such instead of MP4 or WebM being implemented.

Enjay wrote:
That's kind of what I meant: gimp supports it, but only via a plugin (and, honestly, gimp's interface is awful IMO, right up there with Blender except that gimp is inherently a simpler program, so is less confusing), and you mention that several other programs exist but they sound like specific apng editing tools (and I'm going to guess that their bespoke nature also means they are a bit quirky) versus, "as long a you use any graphics program made in the last 12 years or so, it will support apng".

I don't find anything quirky about dedicated and simple tools for making an APNG such as import PNG images in order you want then set universal delay between each image or set it up manually for each.

There are simple and more complex programs, depends on ones preference. Paint.Net also has a plugin for APNG. Also a mod for VirtualDub video editor.

http://littlesvr.ca/apng/
venividivici
 
Joined: 27 Feb 2022
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)

Re: Support for APNG animated image format?

Postby Rachael » Wed Mar 23, 2022 4:36 pm

I am reluctant to close this outright because there is a feasible way to work this into the engine, but it would be limited in doing so. Each frame would be limited to 28.571428--> milliseconds, or multiples thereof, because of the way the current animation system is designed. (The backend animation system might be able to handle it with some modification - but not the actual existing one that is linked to the textures, the ANIMDEFS one)

But this is definitely not a simple "just load the code into GZDoom and press compile ya dummy huehuehue" that a lot of people seem to think coding work is. It would increase complexity of GZDoom in a few key parts where that may not be desirable, especially in places where it shares code with Raze. So as much as I am tempted to close this, I am going to leave it to Graf to do so - maybe he might be willing to live with the limitations and put in a more simplified version of this suggestion - or he might be willing to do a more robust and independent animation system that would allow this to actually function properly without being locked to gamesim frame multiples - or he may agree that this is more effort than it is worth, especially from a long-term maintenance view, and close this.
User avatar
Rachael
^ walking stack of unfinished projects ^
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: Support for APNG animated image format?

Postby Enjay » Wed Mar 23, 2022 5:24 pm

Although I can't find it, I know that gif support has been suggested (perhaps more than once) and rejected before.

Similar reasons for request, as I recall. Though I am obviously aware of the limitations of the gif format versus apng (like, actual gifs, not videos that people call gifs. Kids these days...) thereby making this suggestion slightly different

I think that the main reason explored for not supporting gifs was similar to what has cropped up in this thread. Specifically that they would offer no real advantage over the methods already in GZDoom. Perhaps, if it is still a thing, the legal aspect of gif support may also have been a problem? I *think* that issue may have expired though?
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Support for APNG animated image format?

Postby venividivici » Wed Mar 23, 2022 6:15 pm

I stumbled upon this thread.

viewtopic.php?f=15&t=63160

Graf scoffed at ACS and PAGEDEFS being used for video then mentions Raze that supports video formats, IIRC being SMK and AVI that neither support transparency.

GIF is limited to 8 bit color such as SMK, but also supports transparency while APNG has 24 bit color and transparency. AVI can go 32 bit color yet doesn't have transparency, but also has audio.

Found an informative thread on history of APNG.
https://twitter.com/Foone/status/1206959487434670081

This is neat if one does SVGs.
https://www.bverhue.nl/delphisvg/2021/1 ... i-or-apng/

GZDoom doesn't support GIF and supports PNG thus supporting APNG makes more sense as it is series of PNG images.
venividivici
 
Joined: 27 Feb 2022
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)

Re: Support for APNG animated image format?

Postby Enjay » Wed Mar 23, 2022 6:39 pm

I take, and understand all of your points in favour of the apng format (indeed, I had several of those points in mind when I made my post). The main thing I was trying to say, however, is that support for a self-contained animation format (which just happens to have been gif) has been suggested and rejected before, for reasons very similar to those mentioned here. I even have a nagging feeling that, perhaps, apng has also been suggested before, but I'm much less sure about that.

Ultimately, it's not my call and I wouldn't be left with the responsibility or headache (or not) of implementing and ongoing support of the feature. I was merely pointing out that something similar has been suggested before and, also, that the apng format is a bit niche (to me, your links to add ons and bespoke tools actually confirm as much) and nowhere near as well supported by editing tools as many other formats (admittedly, most of which are not animated - but then GZDoom has most use-cases covered). Indeed, nova++'s initial reaction underlines all that too. It's not that browsers don't support it (most do) but the format really hasn't taken off in any meaningful way and after almost a decade and a half, it's still pretty rare to actually find them I'm the wild. Browsers supporting the format doesn't seem particularly relevant to GZDoom, especially if actual usage of the format, and tool support, is so patchy. But, like I said, it's not my call.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Support for APNG animated image format?

Postby Rachael » Wed Mar 23, 2022 8:34 pm

venividivici wrote:GZDoom doesn't support GIF and supports PNG thus supporting APNG makes more sense as it is series of PNG images.

It just simply is not as simple as that. But how can I expect to reason with you if you fail to see something as fundamental as this? :blergh:
User avatar
Rachael
^ walking stack of unfinished projects ^
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: Support for APNG animated image format?

Postby venividivici » Wed Mar 23, 2022 9:29 pm

Enjay.

Issue with your reply that it hinges too much on how popular or unpopular APNG is as image format which is irrelevant because at its core APNG is series of PNG images with metadata that dictates sequence and timeframe of those.

Debate should not be on popularity as it should be on fuctionality of format and use case.

GIF is limited to 8 bit color and transparency that is also only complete while APNG is 24 bit for both while transparency can be partial/graded along no framerate limitation.

https://www.ionos.com/digitalguide/webs ... t-is-apng/

Comparing GIF to APNG is like equivalent of someone comparing NES to N64 since you again mention GIF. SMK and AVI do not support transparency, former is 8 bit and latter can be 32 bit and can support audio.

Difference between PNG and APNG is that latter has multiple PNG images with additional chunks in single file. Chunk that indicates animation and has multiple images, chunk for frame time and chunk for image data for each image in animation.

https://wiki.mozilla.org/APNG_Specification

GIF and SMK aren't worthy of consideration while AVI would be limited to pre-rendered cutscenes while something like APNG could be used in role of showing pre-rendered cutscenes along being potential to be used in game for textures and sprites.

Rachael wrote:
venividivici wrote:GZDoom doesn't support GIF and supports PNG thus supporting APNG makes more sense as it is series of PNG images.

It just simply is not as simple as that. But how can I expect to reason with you if you fail to see something as fundamental as this? :blergh:


I don't expect it to be simple, but it certainly is simpler to support APNG than GIF.

If nothing else then you Rache or Graf or someone else may be inspired by APNG to create animated PNG format suited for GZDoom.

I am a layman, but looking arounds forums and various wiki that I am questioning sanity such as that for each frame individualy its stated 8 tics.

In that situation should it only be referenced at beginning and interpreted that it switches to next image every 8 tics in order until it reaches the last one? Or better first text references number of tics and each image in file is a number coresponding to a tic.

0 is first image and then every other image has different number such as image with 8 is show when 8th tic is reached until next one replaces once ticking reaches corresponding number of it.

If GZDoom was to support APNG equivalent format then for example name it perhaps SPA = Single Package Animation.

Run.SPA animation has 4 frames then first number for example is 47 then 0, 15, 31 and 47.

I am a layman so tell me if that makes any sense to you or not at all.
venividivici
 
Joined: 27 Feb 2022
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)

Next

Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest