ImagenRawMask

@PublicPreviewAPI
public final classImagenRawMask extendsImagenMaskReference


Represents a mask for Imagen editing. This image should contain only black and white pixels, with black representing parts of the image which should not change.

Summary

Public constructors

Public constructors

ImagenRawMask

public ImagenRawMask(@NonNullImagenInlineImage mask, Double dilation)
Parameters
@NonNullImagenInlineImage mask

the mask image

Double dilation

the amount to dilate the mask. This can help smooth the borders of an edit and make it seem more convincing. For example,0.05 will dilate the mask 5%.

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-28 UTC.