ImagenInlineImage

classImagenInlineImage


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

Summary

Public functions

Bitmap

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

Public properties

ByteArray

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

String

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

Public functions

asBitmap

fun asBitmap(): Bitmap

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

Public properties

data

val dataByteArray

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

mimeType

val mimeTypeString

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

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.