Skip to content

Incorrect boundary rendering in images when using impeller and a color is applied on the image #171178

@intelryzen

Description

@intelryzen

Steps to reproduce

bug in Image.asset when specify a color – a thin boundary appears around the image. Depending on the width and height values, it will either render correctly or show the boundary (this tends to happen when dimensions are odd numbers).

This only happens with Impeller enabled; disabling Impeller makes the issue disappear.

Flutter version: 3.32.4

Repro on emulators:
• Pixel 8 Pro (API 30, Android 11)
• Medium Phone (API 35, Android 15.0)

It’s not yet confirmed whether this also occurs on physical devices.

Expected results

Expected: black image without border

Expected behavior: The black image should be rendered correctly without any visible boundary artifacts.

Actual results

Actual: black border

Actual behavior: The image is rendered with a black boundary around it. Depending on the device and image, that boundary may appear even more pronounced.

Code sample

Code sample
Scaffold(
...
  body: Center(
        child: Image.asset(
          "assets/images/google.png",
          color: Colors.black,
          width: 187, // random odd numbers
          height: 187, // random odd numbers
        ),
      ),
    ); // Scaffold

Screenshots or Video

Screenshots / Video demonstration

This happens in PNG images and specifying a color causes a bug.
From left to right:

  1. No color
  2. Impeller off
  3. Impeller on

No color Impeller off Impeller on

  1. other image

Logs

Logs
log is normal

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.32.4, on macOS 15.5 24F74 darwin-arm64, locale
    ko-KR)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.3)
[✓] VS Code (version 1.101.0)
[✓] Connected device (6 available)
[✓] Network resources

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: imagesLoading, displaying, rendering imagesc: regressionIt was better in the past than it is nowc: renderingUI glitches reported at the engine/skia or impeller rendering levele: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.platform-androidAndroid applications specificallyteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions