ImagenImageFormat

@PublicPreviewAPI
public final class ImagenImageFormat


Represents the format an image should be returned in.

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)

An ImagenImageFormat representing a JPEG image.

static final @NonNull ImagenImageFormat
png()

An ImagenImageFormat representing a PNG image

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.

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