-
Notifications
You must be signed in to change notification settings - Fork 29.1k
Open
Labels
a: imagesLoading, displaying, rendering imagesLoading, displaying, rendering imagesc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterengineflutter/engine repository. See also e: labels.flutter/engine repository. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-engineOwned by Engine teamOwned by Engine team
Description
Use case
When creating a ui.Image
in the following way:
final buffer = await ImmutableBuffer.fromUint8List(data);
final descriptor = ui.ImageDescriptor.raw(
buffer,
width: actualWidth,
height: actualHeight,
pixelFormat: ui.PixelFormat.rgba8888,
);
final codec = await descriptor.instantiateCodec();
final frame = await codec.getNextFrame();
return frame.image;
The bitmap is assumed to be sRGB with seemingly no way to make Flutter consider it as Display P3. This is an unfortunate limitation as it means there is no way to pass a raw bitmap from platform to Dart without having it interpreted as sRGB.
Proposal
It would be great to have a colorSpace
option so that one could describe the image like such:
final descriptor = ui.ImageDescriptor.raw(
buffer,
width: actualWidth,
height: actualHeight,
pixelFormat: ui.PixelFormat.rgba8888,
colorSpace: ColorSpace.displayP3,
);
I have never worked with Flutter internals before, but I may be able to contribute this feature with some guidance on how this could be implemented.
Metadata
Metadata
Assignees
Labels
a: imagesLoading, displaying, rendering imagesLoading, displaying, rendering imagesc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterengineflutter/engine repository. See also e: labels.flutter/engine repository. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-engineOwned by Engine teamOwned by Engine team