ImagenInlineImage

@PublicPreviewAPI
public final class ImagenInlineImage


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 by mimeType.

final @NonNull String

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

Public methods

final @NonNull Bitmap

Returns the image as an Android OS native Bitmap 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 by mimeType.

mimeType

public final @NonNull String mimeType

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

Public methods

asBitmap

public final @NonNull Bitmap asBitmap()

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