ImagenImagePlacement

public final classImagenImagePlacement


Represents where the placement of an image is within a new, larger image, usually in the context of an outpainting request.

Summary

Nested types

Public fields

static final @NonNullImagenImagePlacement

Center the image horizontally and aligned with the bottom edge of the larger image

static final @NonNullImagenImagePlacement

Align the image with the bottom left corner of the larger image

static final @NonNullImagenImagePlacement

Align the image with the bottom right corner of the larger image

static final @NonNullImagenImagePlacement

Center the image horizontally and vertically within the larger image

static final @NonNullImagenImagePlacement

Center the image vertically and aligned with the left edge of the larger image

static final @NonNullImagenImagePlacement

Center the image vertically and aligned with the right edge of the larger image

static final @NonNullImagenImagePlacement

Center the image horizontally and aligned with the top edge of the larger image

static final @NonNullImagenImagePlacement

Align the image with the top left corner of the larger image

static final @NonNullImagenImagePlacement

Align the image with the top right corner of the larger image

finalInteger
finalInteger

Public methods

static final @NonNullImagenImagePlacement
fromCoordinate(int x, int y)

Creates anImagenImagePlacement that represents a placement in an image described by two coordinates.

Public fields

BOTTOM_CENTER

public static final @NonNullImagenImagePlacement BOTTOM_CENTER

Center the image horizontally and aligned with the bottom edge of the larger image

BOTTOM_LEFT

public static final @NonNullImagenImagePlacement BOTTOM_LEFT

Align the image with the bottom left corner of the larger image

BOTTOM_RIGHT

public static final @NonNullImagenImagePlacement BOTTOM_RIGHT

Align the image with the bottom right corner of the larger image

CENTER

public static final @NonNullImagenImagePlacement CENTER

Center the image horizontally and vertically within the larger image

LEFT_CENTER

public static final @NonNullImagenImagePlacement LEFT_CENTER

Center the image vertically and aligned with the left edge of the larger image

RIGHT_CENTER

public static final @NonNullImagenImagePlacement RIGHT_CENTER

Center the image vertically and aligned with the right edge of the larger image

TOP_CENTER

public static final @NonNullImagenImagePlacement TOP_CENTER

Center the image horizontally and aligned with the top edge of the larger image

TOP_LEFT

public static final @NonNullImagenImagePlacement TOP_LEFT

Align the image with the top left corner of the larger image

TOP_RIGHT

public static final @NonNullImagenImagePlacement TOP_RIGHT

Align the image with the top right corner of the larger image

x

public final Integer x

y

public final Integer y

Public methods

fromCoordinate

public static final @NonNullImagenImagePlacement fromCoordinate(int x, int y)

Creates anImagenImagePlacement that represents a placement in an image described by two coordinates. The coordinate system has 0,0 in the top left corner, and the x and y coordinates represent the location of the top left corner of the original image.

Parameters
int x

the x coordinate of the top left corner of the original image

int y

the y coordinate of the top left corner of the original 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-08-08 UTC.