1

I need an animation format to store transparent (RGBA) images used in C#. Requirements:

  • Alpha channel support
  • Random access to frames
  • C# support ideally

I've checked WebP and APNG, but there is no random access (because of the "relative-to-previous" frame rendering). And I can't use any video format because I need to playback faster/slower and the loading of video takes ages (can't play immediately after load).

Edit 1: I need to play the animation at variable speed (that's why need random access).

Michal Pokluda
  • 390
  • 4
  • 11
  • What do you mean by "C# support", exactly? That's a bit vague. Specify how you need to interact with the image files using C#. – ADyson Sep 23 '20 at 08:31
  • Any C# library allowing me to read raw frame data (RGBA) from the animation. But if it's C++ and dll, that's ok as well. – Michal Pokluda Sep 23 '20 at 08:50
  • Ok. So are you asking us to find you a 3rd-party library? Just so you know, asking for recommendations is off-topic - you can read about why that is the case [here](https://stackoverflow.com/help/on-topic) (see item 4). – ADyson Sep 23 '20 at 09:44
  • Also, are there any other constraints around the animation format - e.g. where does it need to be displayed? (in a web page, and/or something else?). Because where you need to use it later might also constrain what format you can use. FWIW I'm not an expert on these formats, especially the random access stuff but from a brief bit of searching I'm not convinced there necessarily even exists a file format which necessarily meets all your requirements. Have you looked at good old GIF? I know its transparency support is very limited, that's all. or SVG? – ADyson Sep 23 '20 at 09:46
  • Or simply a code-based solution? https://stackoverflow.com/questions/6402633/what-alternatives-for-animated-gifs-are-there . It's hard to know what would be best, without more knowledge of what you intend to use the images for. – ADyson Sep 23 '20 at 09:49
  • SVG is not image format. GIF is old and only 256 colors (although it can be somehow split into multiple rectangles). All other formats I know don't allow random access frames - which is required to display animation at variable speed (2x, 3x and faster). Random access can be achieved in quicktime mov, but quicktime is not supported by Windows 10 anymore (and it doesn't work good in W10 indeed). – Michal Pokluda Sep 23 '20 at 10:14
  • _SVG is not image format_ ...no but it's a graphics format, and there are ways it can be used for creating and showing animations. That's the overall goal, right? Is there a specific reason why you _couldn't_ use it? – ADyson Sep 23 '20 at 10:57
  • No, my goal is to be able to convert existing videos (e.g. in mp4) and have the ability to play them faster/slower (or random access). But don't want to split them into multiple png/jpg files. – Michal Pokluda Sep 23 '20 at 11:09
  • any specific reason you don't want to do that? If you make small enough images you could easily just rotate them at speed. Because I don't think the thing you're asking for right now actually exists. – ADyson Sep 23 '20 at 11:11
  • It takes too much of space on disk, it's impractical and the performance is not good. And it's amateur solution (given the software will be used by clients). – Michal Pokluda Sep 23 '20 at 11:37
  • It's not an amateur solution if no other "better" solution exists! P.s. like I asked earlier, what are the other constraints? E.g. where are you planning to use this? In a web page? If the images are small enough, performance shouldn't be a big issue. Neither should disk space. What quality level are you aiming for? What image size is needed (in pixels). – ADyson Sep 23 '20 at 11:58
  • It's for WPF/C# application, which is used to play video content. Like a video editor. FullHD images will be used. – Michal Pokluda Sep 23 '20 at 13:51

0 Answers0