ImagenImageFormat

public final 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

Nested types

public static class ImagenImageFormat.Companion

Public fields

final Integer

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.

final @NonNull String

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

Public methods

static final @NonNull ImagenImageFormat
jpeg(Integer compressionQuality)

This method is deprecated. All Imagen models are deprecated.

static final @NonNull ImagenImageFormat
png()

This method is deprecated. All Imagen models are deprecated.

Public fields

compressionQuality

public final Integer compressionQuality

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

public final @NonNull String mimeType

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

Public methods

jpeg

public static final @NonNull ImagenImageFormat jpeg(Integer compressionQuality)

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
Integer compressionQuality

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

public static final @NonNull ImagenImageFormat png()

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)