Skip to content

ImageIcon does not render source image color whilst Image.asset does #180463

Description

@huycozy

Steps to reproduce

  • When loading an image with ImageIcon widget, the color is lost
ImageIcon(AssetImage('assets/icons/premium.png'))
  • However, using Image.assets is fine
Image.asset(
  'assets/icons/premium.png',
  width: 24,
  height: 24,
)

I tested on Android, Web (Chrome), and macOS platforms, having same result.

Expected results

Image

Actual results

Image

Code sample

Code sample Image

Place this image source in your assets directory and display it with ImageIcon widget:

ImageIcon(AssetImage('assets/icons/premium.png'))

Screenshots or Video

Screenshots / Video demonstration Image

Logs

Logs

No special logs/warning is out

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.38.5, on macOS 26.0 25A354 darwin-arm64, locale en-US) [176ms]
    • Flutter version 3.38.5 on channel stable at /Users/huym4/Documents/WORKING/SDK/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f6ff1529fd (3 weeks ago), 2025-12-11 11:50:07 -0500
    • Engine revision 1527ae0ec5
    • Dart version 3.10.4
    • DevTools version 2.51.1
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, omit-legacy-version-file, enable-lldb-debugging

[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [790ms]
    • Android SDK at /Users/huym4/Library/Android/sdk
    • Emulator version 35.5.10.0 (build_id 13402964) (CL:N/A)
    • Platform android-36, build-tools 36.0.0
    • ANDROID_HOME = /Users/huym4/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.8+-14196175-b1038.72)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 26.0.1) [420ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 17A400
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [3ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Connected device (4 available) [5.8s]
    • RMX2001 (mobile)                        • EUYTFEUSQSRGDA6D          • android-arm64  • Android 11 (API 30)
    • Huy’s iPhone 15 Pro (wireless) (mobile) • 00008130-001460A82612001C • ios            • iOS 26.0.1 23A355
    • macOS (desktop)                         • macos                     • darwin-arm64   • macOS 26.0 25A354 darwin-arm64
    • Chrome (web)                            • chrome                    • web-javascript • Google Chrome 143.0.7499.170

[✓] Network resources [364ms]
    • 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: assetsPackaging, accessing, or using assetsa: imagesLoading, displaying, rendering imagesfound in release: 3.38Found to occur in 3.38found in release: 3.40Found to occur in 3.40frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions