Skip to content

Add support for APNG (Animated PNG) #37247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ndac-todoroki opened this issue Jul 30, 2019 · 38 comments · Fixed by flutter/engine#31098
Closed

Add support for APNG (Animated PNG) #37247

ndac-todoroki opened this issue Jul 30, 2019 · 38 comments · Fixed by flutter/engine#31098
Assignees
Labels
c: new feature Nothing broken; request for a new capability customer: crowd Affects or could affect many people, though not necessarily a specific customer. customer: fuchsia engine flutter/engine repository. See also e: labels. framework flutter/packages/flutter repository. See also f: labels. P3 Issues that are less important to the Flutter project

Comments

@ndac-todoroki
Copy link

ndac-todoroki commented Jul 30, 2019

Use case

I want to create a animation picture viewer, and many of the contents are APNG.
APNG is a standard and most of the modern browsers (Firefox, Chrome, Safari and iOS supports it), has good binary size compression compared to GIF, is more colourful, and artists love PNG!

Proposal

It would be great if the Image widget supports APNG out of the box. Currently it supports PNG, so the first frame of the file will be shown (APNG has backward compatibility for PNG).

@timsneath timsneath added the c: new feature Nothing broken; request for a new capability label Jul 30, 2019
@premingiet
Copy link

Is there any progress regarding APNG support ? I currently feel like i need it a lot. Why is APNG format not supported in image widget out of the box ? Its a very common format.

@VladyslavBondarenko VladyslavBondarenko added customer: crowd Affects or could affect many people, though not necessarily a specific customer. framework flutter/packages/flutter repository. See also f: labels. labels Jan 14, 2020
@aminjoharinia
Copy link

we are waiting for APNG support :)

@cbracken cbracken added the engine flutter/engine repository. See also e: labels. label Apr 9, 2020
@justinperezd
Copy link

still waiting for the apng support

@sveinbjornt
Copy link

I, too, would like to see APNG support!

@hienlh
Copy link

hienlh commented Aug 11, 2020

Waiting!

@daniuwo
Copy link

daniuwo commented Aug 29, 2020

Looking forward to seeing apng support!

@cbracken cbracken self-assigned this Sep 3, 2020
@cbracken cbracken added this to the 1.24 - October 2020 milestone Sep 3, 2020
@apwilson
Copy link
Contributor

apwilson commented Oct 5, 2020

+1 for apng support.

In addition as part of the API I'd like to see:

  1. a callback where we can trigger something to happen after the Nth frame of the animation (Edit: I could probably do without this by using a manual Timer so long as I know when the animation starts)
  2. a callback when the animation is done.

@kf6gpe
Copy link
Contributor

kf6gpe commented Oct 20, 2020

(for triage) @cbracken How's this looking for the October milestone? I've had conversations with customer: dream (g3) and they're interested in this too.

@cbracken
Copy link
Member

cbracken commented Oct 22, 2020

I suspect this will slip by a couple weeks to mid-Nov. It is WIP but there are a lot of edge-cases to test in the spec.

@wanjm

This comment has been minimized.

@kf6gpe
Copy link
Contributor

kf6gpe commented Nov 10, 2020

(Critical issue triage) @cbracken How is this looking? Mid-Nov is nearly upon us! Thanks.

@loody5566
Copy link

apng support please,

@loody5566
Copy link

still waiting for the apng support

@chinmaygarde
Copy link
Member

@cbracken I updated the milestone since the previous one expired. Please feel free to update it to something else if that is not realistic.

@Hixie Hixie added P1 High-priority issues at the top of the work list and removed P2 labels Dec 2, 2020
@zanderso zanderso removed this from the January Beta Release (1.26) milestone Jan 11, 2021
@zanderso
Copy link
Member

zanderso commented May 3, 2021

I believe this work was reprioritized, but the issue was not updated to match. I will update the priority to match my understanding. I will also repeat my gentle ping to @cbracken to ask if there is a draft PR that could be handed off.

@zanderso zanderso added P3 Issues that are less important to the Flutter project and removed P1 High-priority issues at the top of the work list customer: dream (g3) labels May 3, 2021
@sourcecaster
Copy link

I'm currently developing custom 2d engine canvas widget and came to conclusion that APNG support is so much required :) WEBP is cool, but not good enough. And not so common as APNG. So, +1 for APNG support.

@biij5698
Copy link

still waiting for the apng support

@ChristopherDelgado
Copy link

still waiting for apng support!

@ConanShin
Copy link

still waiting...

@Formerly
Copy link

Formerly commented Sep 7, 2021

still waiting for apng support!

@hieudz
Copy link

hieudz commented Sep 9, 2021

still waiting for apng support!, please :'(

@ghost
Copy link

ghost commented Sep 16, 2021

still waiting for apng support desperately!

@bdero bdero self-assigned this Sep 23, 2021
@bdero
Copy link
Member

bdero commented Sep 23, 2021

I'm currently working on a stopgap solution for this. We might be able to support this in Skia's PNG codec directly, so I filed a request for that too: https://bugs.chromium.org/p/skia/issues/detail?id=12474

@bdero
Copy link
Member

bdero commented Oct 12, 2021

Progress update on APNGs (branch diff: flutter/engine@master...bdero:bdero/apng-decoder):

Here's a video of this test suite and a few additional images (app: https://github.com/bdero/flutter-apng-tests):

Screen.Recording.2021-10-12.at.2.02.32.PM.mov

The APNG stream demuxing is stable and the frame timing/disposal ops are looking right, but I'm still working on some essential functionality for getting this merged:

  • Essential: Drawing/positioning frames with smaller dimensions than the "default" image. This is what's causing the 4 decoding failures (the images with X's) visible in the video above.
  • Essential: Frame blending ops. The white images are mostly supposed to appear desaturated yellow due to semi-transparent frames.
  • Essential: APNG_DISPOSE_OP_PREVIOUS -- currently this is behaving like the discard op.
  • Possibly: Validate the APNG-specific chunk sequence values and validate that chunks are contiguous.
  • Not planned: Detect/interpret the pHYs chunk and apply DPI scaling to frame offsets.

@Til555
Copy link

Til555 commented Nov 4, 2021

Thanks @bdero for looking into this!

@AphinityApp

This comment was marked as off-topic.

@keanallen

This comment was marked as off-topic.

@sveinbjornt

This comment was marked as off-topic.

@nizwar
Copy link

nizwar commented Aug 8, 2022

been 3 years since this issue, @bdero any update?

@lucianobargmann
Copy link

This is is great, but much more needed is support for transparent WEBM (VP8 or VP9 codecs); I would use APNG if it was available as a workaround.

@eximius313
Copy link

@bdero - maybe you could publish your code as a plugin?

@sveinbjornt
Copy link

Thanks @bdero, there is real need for this.

@bugrevealingbme
Copy link

any update?

@github-actions
Copy link

github-actions bot commented Mar 3, 2023

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: new feature Nothing broken; request for a new capability customer: crowd Affects or could affect many people, though not necessarily a specific customer. customer: fuchsia engine flutter/engine repository. See also e: labels. framework flutter/packages/flutter repository. See also f: labels. P3 Issues that are less important to the Flutter project
Projects
None yet
Development

Successfully merging a pull request may close this issue.