Interface IPromptImageConvertBuilder
public interface IPromptImageConvertBuilder
A builder for a converter that can post-process images.
- Since:
- 8.5.0
-
Method Summary
Modifier and TypeMethodDescriptionalphaChannel(IPromptImageAlphaChannelConverter converter) Adjusts the alpha channel of the image using the given converter.backgroundColor(RgbaQuadruplet backgroundColor) Sets the background color of the image, used as a default color for pixels, e.g. when the source image has transparency or when the image is resized and the canvas is larger than the image.backgroundColor(RgbTriplet backgroundColor) Sets the background color of the image, used as a default color for pixels, e.g. when the source image has transparency or when the image is resized and the canvas is larger than the image.build()Builds a new converter for post-processing images, using the current builder configuration.compression(double compression) Sets the compression level of the image if needed, e.g. for JPEG images.format(IPromptImageFormatConverter converter) Transforms the output format of the image using the given converter, e.g. to "png" or "jpeg".geometry(IPromptImageGeometryConverter converter) Changes the geometry of the image using the given converter.
-
Method Details
-
alphaChannel
@CanIgnoreReturnValue IPromptImageConvertBuilder alphaChannel(IPromptImageAlphaChannelConverter converter) Adjusts the alpha channel of the image using the given converter.- Parameters:
converter- The converter.- Returns:
- The builder.
- See Also:
-
backgroundColor
Sets the background color of the image, used as a default color for pixels, e.g. when the source image has transparency or when the image is resized and the canvas is larger than the image.- Parameters:
backgroundColor- The background color.- Returns:
- The builder.
-
backgroundColor
Sets the background color of the image, used as a default color for pixels, e.g. when the source image has transparency or when the image is resized and the canvas is larger than the image.- Parameters:
backgroundColor- The background color.- Returns:
- The builder.
-
build
IPromptImageConverter build()Builds a new converter for post-processing images, using the current builder configuration.- Returns:
- The converter.
-
compression
Sets the compression level of the image if needed, e.g. for JPEG images.- Parameters:
compression- The compression level, between 0.0 (lowest quality, highest compression) and 1.0 (highest quality, lowest compression).- Returns:
- The builder.
-
format
Transforms the output format of the image using the given converter, e.g. to "png" or "jpeg". When not set, the original format is preserved.- Parameters:
converter- The converter.- Returns:
- The builder.
- See Also:
-
geometry
Changes the geometry of the image using the given converter. SeePromptImageGeometryConvertersfor various common converters.- Parameters:
converter- The converters.- Returns:
- The builder.
- See Also:
-