ImagenImageFormat

class ImagenImageFormat


Represents the format an image should be returned in.

Deprecation Notice: All Imagen models are deprecated and will shut down as early as June 2026. As a replacement, you can migrate your apps to use Gemini Image models (the 'Nano Banana' models)

Summary

Public companion functions

ImagenImageFormat
jpeg(compressionQuality: Int?)

This function is deprecated. All Imagen models are deprecated.

ImagenImageFormat
png()

This function is deprecated. All Imagen models are deprecated.

Public properties

Int?

an int (1-100) representing the quality of the image; a lower number means the image is permitted to be lower quality to reduce size.

String

A string (like "image/jpeg") specifying the encoding MIME type of the image.

Public companion functions

jpeg

fun jpeg(compressionQuality: Int? = null): ImagenImageFormat

An ImagenImageFormat representing a JPEG image.

Deprecation Notice: All Imagen models are deprecated and will shut down as early as June 2026. As a replacement, you can migrate your apps to use Gemini Image models (the 'Nano Banana' models)

Parameters
compressionQuality: Int? = null

an int (1-100) representing the quality of the image; a lower number means the image is permitted to be lower quality to reduce size.

png

fun png(): ImagenImageFormat

An ImagenImageFormat representing a PNG image

Deprecation Notice: All Imagen models are deprecated and will shut down as early as June 2026. As a replacement, you can migrate your apps to use Gemini Image models (the 'Nano Banana' models)

Public properties

compressionQuality

val compressionQualityInt?

an int (1-100) representing the quality of the image; a lower number means the image is permitted to be lower quality to reduce size. This parameter is not relevant for every MIME type.

mimeType

val mimeTypeString

A string (like "image/jpeg") specifying the encoding MIME type of the image.