Skip to content

[Impeller] Using Image with specified color causes weird behavior #144109

@michalsrutek

Description

@michalsrutek

Steps to reproduce

Using Image.asset and specifying non-null color causes the Widget's frame to be different - which can be seen when a Transform is used.

Minimum reproducible example at https://github.com/michalsrutek/flutter-image-asset-color-bug

  1. Clone project
  2. Drag along the grey area - to start rotating the image - using a Transform widget

Expected results

The frame for color: null is the same as the frame for color: (any-non-null-value).

Actual results

The frame is different.

Code sample

Code sample

Minimum reproducible example at https://github.com/michalsrutek/flutter-image-asset-color-bug

Image.asset(
    'assets/img.png',
    width: innerCircleWidth,
    height: innerCircleWidth,
    // !!! Using a color does something weird
    color: useColor ? Colors.orange : null,
),

Screenshots or Video

Screenshots / Video demonstration

Logs

Logs
not important

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.1, on macOS 13.6 22G120 darwin-arm64, locale en-CZ)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.86.2)
[✓] Connected device (3 available)
[✓] Network resources

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: imagesLoading, displaying, rendering imagesc: renderingUI glitches reported at the engine/skia or impeller rendering levele: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.found in release: 3.19Found to occur in 3.19found in release: 3.20Found to occur in 3.20has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions