ImagenImageFormat

classImagenImageFormat


Represents the format an image should be returned in.

Summary

Public companion functions

ImagenImageFormat
jpeg(compressionQuality: Int?)

AnImagenImageFormat representing a JPEG image.

ImagenImageFormat
png()

AnImagenImageFormat representing a PNG image

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

AnImagenImageFormat representing a JPEG image.

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

AnImagenImageFormat representing a PNG image

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.

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.