ImagenInlineImage

public final classImagenInlineImage


Represents an Imagen-generated image that is returned as inline data.

Summary

Public fields

final @NonNull byte[]

The raw image bytes in JPEG or PNG format, as specified bymimeType.

final @NonNullString

The IANA standard MIME type of the image data; either"image/png" or"image/jpeg"; to request a different format, seeImagenGenerationConfig.imageFormat.

Public methods

final @NonNullBitmap

Returns the image as an Android OS nativeBitmap so that it can be saved or sent to the UI.

Public fields

data

public final @NonNull byte[] data

The raw image bytes in JPEG or PNG format, as specified bymimeType.

mimeType

public final @NonNullString mimeType

The IANA standard MIME type of the image data; either"image/png" or"image/jpeg"; to request a different format, seeImagenGenerationConfig.imageFormat.

Public methods

asBitmap

public final @NonNullBitmap asBitmap()

Returns the image as an Android OS nativeBitmap so that it can be saved or sent to the UI.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-09 UTC.