Skip to content

Apng(Animated Png) with alpha channel won't get blended to background properly #128102

@nagataaaas

Description

@nagataaaas

Is there an existing issue for this?

Steps to reproduce

  1. create apng with alpha channel which has slightly transparent(not perfectly intransparent, nor perfectly transparent. consider like shadows that darken the background color).
  2. show it with Image widget, e.g. Image.asset("assets/animated.apng")
  3. On Android, this will cause buggy behavior. The more transparent the pixel is, the brighter it will be.

Expected results

Image will be mixed with the background, corresponding to the value of the alpha channel.

Actual results

On Android, 100% transparent pixel will be fine, but other pixel will gets whiter and not transparent.

On web (dartpad), the behavior is totally fine.

Code sample

Code sample

dartpad here

Screenshots or Video

Screenshots / Video demonstration

tested apng is this below.
apng

Expected result (dartpad behavior)

2023-06-02.145019.mp4

Actual result (Android Pixel 7 Pro)

screen-20230602-144922.2.mp4

Logs

Logs

log is too long to write here, so uploaded to gist
https://gist.github.com/nagataaaas/fa74ad7bcf7c3565f0a8d0e1087d35b6#file-flutter_verbose-log

Flutter Doctor output

Doctor output
[√] Flutter (Channel stable, 3.10.2, on Microsoft Windows [Version 10.0.22621.1755], locale ja-JP)
    • Flutter version 3.10.2 on channel stable at C:\Users\nagata\Desktop\tools\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9cd3d0d9ff (9 days ago), 2023-05-23 20:57:28 -0700
    • Engine revision 90fa3ae28f
    • Dart version 3.0.2
    • DevTools version 2.23.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at C:\Users\nagata\AppData\Local\Android\sdk
    • Platform android-33-ext5, build-tools 33.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version openjdk version "11.0.15" 2022-04-19
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Enterprise 2019 16.8.2)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise
    • Visual Studio Enterprise 2019 version 16.8.30717.126
    • Windows 10 SDK version 10.0.18362.0

[√] Android Studio (version 2022.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version openjdk version "11.0.15" 2022-04-19

[√] IntelliJ IDEA Ultimate Edition (version 2020.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2020.2.2
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart

[√] VS Code (version 1.78.2)
    • VS Code at C:\Users\nagata\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.64.0

[√] Connected device (4 available)
    • Pixel 7 Pro (mobile) • 2B071FDH300330 • android-arm64  • Android 13 (API 33)
    • Windows (desktop)    • windows        • windows-x64    • Microsoft Windows [Version 10.0.22621.1755]
    • Chrome (web)         • chrome         • web-javascript • Google Chrome 113.0.5672.127
    • Edge (web)           • edge           • web-javascript • Microsoft Edge 113.0.1774.50

[√] Network resources
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: imagesLoading, displaying, rendering imagesengineflutter/engine related. See also e: labels.found in release: 3.10Found to occur in 3.10found in release: 3.11Found to occur in 3.11has reproducible stepsThe issue has been confirmed reproducible and is ready to work on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions