Interface IPromptImageConvertBuilder


public interface IPromptImageConvertBuilder
A builder for a converter that can post-process images.
Since:
8.5.0
  • 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

      @CanIgnoreReturnValue IPromptImageConvertBuilder 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.
      Parameters:
      backgroundColor - The background color.
      Returns:
      The builder.
    • backgroundColor

      @CanIgnoreReturnValue IPromptImageConvertBuilder 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.
      Parameters:
      backgroundColor - The background color.
      Returns:
      The builder.
    • build

      Builds a new converter for post-processing images, using the current builder configuration.
      Returns:
      The converter.
    • compression

      @CanIgnoreReturnValue IPromptImageConvertBuilder compression(double 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

      @CanIgnoreReturnValue IPromptImageConvertBuilder format(IPromptImageFormatConverter converter)
      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

      @CanIgnoreReturnValue IPromptImageConvertBuilder geometry(IPromptImageGeometryConverter converter)
      Changes the geometry of the image using the given converter. See PromptImageGeometryConverters for various common converters.
      Parameters:
      converter - The converters.
      Returns:
      The builder.
      See Also: