Skip to content

[camera_android_camerax] Support RGBA_8888 image format group  #151193

Open
flutter/packages
#11632

Description

@TecHaxter

Use case

The plugin only supports YUV_420 image format group, because Flutter does not support RGBA format currently.
But the camerax library allows RGBA_8888 format group as well.
Supporting RGBA_8888 format would allow flutter developers to do computer vision tasks like face detection, image classification, image segmentation, etc.

Proposal

Expecting the plugin to be able to do something like this:

CameraController cameraController = CameraController(
    cameras![selectedCameraIndex],
    ResolutionPreset.medium,
    imageFormatGroup: ImageFormatGroup.rgba8888,
);
cameraController.startImageStream((CameraImage image) {
    ///Computer vision tasks with rgba8888 image format group bytes
});

Reference

Found this while reading the documented source code of intializeCamera in packages\camera\camera_android_camerax\lib\src\android_camera_camerax.dart

  /// Initializes the camera on the device.
  ///
  /// Since initialization of a camera does not directly map as an operation to
  /// the CameraX library, this method just retrieves information about the
  /// camera and sends a [CameraInitializedEvent].
  ///
  /// [imageFormatGroup] is used to specify the image format used for image
  /// streaming, but CameraX currently only supports YUV_420_888 (supported by
  /// Flutter) and RGBA (not supported by Flutter). CameraX uses YUV_420_888
  /// by default, so [imageFormatGroup] is not used.
  @override
  Future<void> initializeCamera(
    int cameraId, {
    ImageFormatGroup imageFormatGroup = ImageFormatGroup.unknown,
  }) async {
  ...
  }

Activity

  1. added
    in triagePresently being triaged by the triage team
    c: new featureNothing broken; request for a new capability
    platform-androidAndroid applications specifically
    packageflutter/packages repository. See also p: labels.
    c: proposalA detailed proposal for a change to Flutter
    team-androidOwned by Android platform team
    and removed
    in triagePresently being triaged by the triage team
    on Jul 3, 2024
  2. added
    P2Important issues not at the top of the work list
    triaged-androidTriaged by Android platform team
    on Jul 11, 2024
  3. moved this to Not blocking deletion in Deprecating camera_androidon Jul 7, 2025
  4. Mairramer commented on Apr 29, 2026

    @Mairramer
    Contributor

    I’ll take a look at this later.

  5. self-assigned this
    on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterp: cameraThe camera pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions