Class Transformation
-
- All Implemented Interfaces:
public final class TransformationThe SDK provides easy-to-use names for transformations. These names are converted to the corresponding transformation string before being added to the URL. SDKs are updated regularly to support new transformations. If you want to use a transformation that is not supported by the SDK, You can use the
rawparameter to pass the transformation string directly. See the Transformations documentation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classTransformation.BuilderA builder for Transformation.
public final classTransformation.AiDropShadowAdds an AI-based drop shadow around a foreground object on a transparent or removed background. Optionally, control the direction, elevation, and saturation of the light source (e.g.,
az-45to change light direction). Passtruefor the default drop shadow, or provide a string for a custom drop shadow. Supported inside overlay. See AI Drop Shadow.public final classTransformation.AiRemoveBackgroundApplies ImageKit's in-house background removal. Supported inside overlay. See AI Background Removal.
public final classTransformation.AiRemoveBackgroundExternalUses third-party background removal. Note: It is recommended to use aiRemoveBackground, ImageKit's in-house solution, which is more cost-effective. Supported inside overlay. See External Background Removal.
public final classTransformation.AiRetouchPerforms AI-based retouching to improve faces or product shots. Not supported inside overlay. See AI Retouch.
public final classTransformation.AiUpscaleUpscales images beyond their original dimensions using AI. Not supported inside overlay. See AI Upscale.
public final classTransformation.AiVariationGenerates a variation of an image using AI. This produces a new image with slight variations from the original, such as changes in color, texture, and other visual elements, while preserving the structure and essence of the original image. Not supported inside overlay. See AI Generate Variations.
public final classTransformation.AspectRatioSpecifies the aspect ratio for the output, e.g., "ar-4-3". Typically used with either width or height (but not both). For example: aspectRatio =
4:3,4_3, or an expression likeiar_div_2. See Image resize and crop – Aspect ratio.public final classTransformation.AudioCodecSpecifies the audio codec, e.g.,
aac,opus, ornone. See Audio codec.public final classTransformation.ContrastStretchAutomatically enhances the contrast of an image (contrast stretch). See Contrast Stretch.
public final classTransformation.CropCrop modes for image resizing. See Crop modes & focus.
public final classTransformation.CropModeAdditional crop modes for image resizing. See Crop modes & focus.
public final classTransformation.DurationSpecifies the duration (in seconds) for trimming videos, e.g.,
5or10.5. Typically used with startOffset to indicate the length from the start offset. Arithmetic expressions are supported. See Trim videos – Duration.public final classTransformation.EndOffsetSpecifies the end offset (in seconds) for trimming videos, e.g.,
5or10.5. Typically used with startOffset to define a time window. Arithmetic expressions are supported. See Trim videos – End offset.public final classTransformation.FlipFlips or mirrors an image either horizontally, vertically, or both. Acceptable values:
h(horizontal),v(vertical),h_v(horizontal and vertical), orv_h. See Flip.public final classTransformation.FormatSpecifies the output format for images or videos, e.g.,
jpg,png,webp,mp4, orauto. You can also passorigfor images to return the original format. ImageKit automatically delivers images and videos in the optimal format based on device support unless overridden by the dashboard settings or the format parameter. See Image format and Video format.public final classTransformation.GradientCreates a linear gradient with two colors. Pass
truefor a default gradient, or provide a string for a custom gradient. See Gradient.public final classTransformation.GrayscaleEnables a grayscale effect for images. See Grayscale.
public final classTransformation.HeightSpecifies the height of the output. If a value between 0 and 1 is provided, it is treated as a percentage (e.g.,
0.5represents 50% of the original height). You can also supply arithmetic expressions (e.g.,ih_mul_0.5). Height transformation – Images · Videospublic final classTransformation.PageExtracts a specific page or frame from multi-page or layered files (PDF, PSD, AI). For example, specify by number (e.g.,
2), a range (e.g.,3-4for the 2nd and 3rd layers), or by name (e.g.,name-layer-4for a PSD layer). See Thumbnail extraction.public final classTransformation.RadiusSpecifies the corner radius for rounded corners.
Single value (positive integer): Applied to all corners (e.g.,
20).max: Creates a circular or oval shape.Per-corner array: Provide four underscore-separated values representing top-left, top-right, bottom-right, and bottom-left corners respectively (e.g.,
10_20_30_40). See Radius.
public final classTransformation.RotationSpecifies the rotation angle in degrees. Positive values rotate the image clockwise; you can also use, for example,
N40for counterclockwise rotation orautoto use the orientation specified in the image's EXIF data. For videos, only the following values are supported: 0, 90, 180, 270, or 360. See Rotate.public final classTransformation.ShadowAdds a shadow beneath solid objects in an image with a transparent background. For AI-based drop shadows, refer to aiDropShadow. Pass
truefor a default shadow, or provide a string for a custom shadow. See Shadow.public final classTransformation.SharpenSharpens the input image, highlighting edges and finer details. Pass
truefor default sharpening, or provide a numeric value for custom sharpening. See Sharpen.public final classTransformation.StartOffsetSpecifies the start offset (in seconds) for trimming videos, e.g.,
5or10.5. Arithmetic expressions are also supported. See Trim videos – Start offset.public final classTransformation.TrimUseful for images with a solid or nearly solid background and a central object. This parameter trims the background, leaving only the central object in the output image. See Trim edges.
public final classTransformation.UnsharpMaskApplies Unsharp Masking (USM), an image sharpening technique. Pass
truefor a default unsharp mask, or provide a string for a custom unsharp mask. See Unsharp Mask.public final classTransformation.VideoCodecSpecifies the video codec, e.g.,
h264,vp9,av1, ornone. See Video codec.public final classTransformation.WidthSpecifies the width of the output. If a value between 0 and 1 is provided, it is treated as a percentage (e.g.,
0.4represents 40% of the original width). You can also supply arithmetic expressions (e.g.,iw_div_2). Width transformation – Images · Videospublic final classTransformation.XFocus using cropped image coordinates - X coordinate. See Focus using cropped coordinates.
public final classTransformation.XCenterFocus using cropped image coordinates - X center coordinate. See Focus using cropped coordinates.
public final classTransformation.YFocus using cropped image coordinates - Y coordinate. See Focus using cropped coordinates.
public final classTransformation.YCenterFocus using cropped image coordinates - Y center coordinate. See Focus using cropped coordinates.
-
Method Summary
Modifier and Type Method Description final Optional<String>aiChangeBackground()Uses AI to change the background. final Optional<Transformation.AiDropShadow>aiDropShadow()Adds an AI-based drop shadow around a foreground object on a transparent or removed background. final Optional<String>aiEdit()Uses AI to edit images based on a text prompt. final Optional<Transformation.AiRemoveBackground>aiRemoveBackground()Applies ImageKit's in-house background removal. final Optional<Transformation.AiRemoveBackgroundExternal>aiRemoveBackgroundExternal()Uses third-party background removal. final Optional<Transformation.AiRetouch>aiRetouch()Performs AI-based retouching to improve faces or product shots. final Optional<Transformation.AiUpscale>aiUpscale()Upscales images beyond their original dimensions using AI. final Optional<Transformation.AiVariation>aiVariation()Generates a variation of an image using AI. final Optional<Transformation.AspectRatio>aspectRatio()Specifies the aspect ratio for the output, e.g., "ar-4-3". final Optional<Transformation.AudioCodec>audioCodec()Specifies the audio codec, e.g. final Optional<String>background()Specifies the background to be used in conjunction with certain cropping strategies when resizing an image. final Optional<Double>blur()Specifies the Gaussian blur level. final Optional<String>border()Adds a border to the output media. final Optional<String>colorize()Applies a color tint to the image. final Optional<Boolean>colorProfile()Indicates whether the output image should retain the original color profile. final Optional<String>colorReplace()Replaces colors in the image. final Optional<Transformation.ContrastStretch>contrastStretch()Automatically enhances the contrast of an image (contrast stretch). final Optional<Transformation.Crop>crop()Crop modes for image resizing. final Optional<Transformation.CropMode>cropMode()Additional crop modes for image resizing. final Optional<String>defaultImage()Specifies a fallback image if the resource is not found, e.g., a URL or file path. final Optional<String>distort()Distorts the shape of an image. final Optional<Double>dpr()Accepts values between 0. final Optional<Transformation.Duration>duration()Specifies the duration (in seconds) for trimming videos, e.g. final Optional<Transformation.EndOffset>endOffset()Specifies the end offset (in seconds) for trimming videos, e.g. final Optional<Transformation.Flip>flip()Flips or mirrors an image either horizontally, vertically, or both. final Optional<String>focus()Refines padding and cropping behavior for pad resize, maintain ratio, and extract crop modes. final Optional<Transformation.Format>format()Specifies the output format for images or videos, e.g. final Optional<Transformation.Gradient>gradient()Creates a linear gradient with two colors. final Optional<Transformation.Grayscale>grayscale()Enables a grayscale effect for images. final Optional<Transformation.Height>height()Specifies the height of the output. final Optional<Boolean>lossless()Specifies whether the output image (in JPEG or PNG) should be compressed losslessly. final Optional<Boolean>metadata()By default, ImageKit removes all metadata during automatic image compression. final Optional<String>named()Named transformation reference. final Optional<Double>opacity()Specifies the opacity level of the output image. final Optional<Boolean>original()If set to true, serves the original file without applying any transformations. final Optional<Overlay>overlay()Specifies an overlay to be applied on the parent image or video. final Optional<Transformation.Page>page()Extracts a specific page or frame from multi-page or layered files (PDF, PSD, AI). final Optional<Boolean>progressive()Specifies whether the output JPEG image should be rendered progressively. final Optional<Double>quality()Specifies the quality of the output image for lossy formats such as JPEG, WebP, and AVIF. final Optional<Transformation.Radius>radius()Specifies the corner radius for rounded corners. final Optional<String>raw()Pass any transformation not directly supported by the SDK. final Optional<Transformation.Rotation>rotation()Specifies the rotation angle in degrees. final Optional<Transformation.Shadow>shadow()Adds a shadow beneath solid objects in an image with a transparent background. final Optional<Transformation.Sharpen>sharpen()Sharpens the input image, highlighting edges and finer details. final Optional<Transformation.StartOffset>startOffset()Specifies the start offset (in seconds) for trimming videos, e.g. final Optional<List<StreamingResolution>>streamingResolutions()An array of resolutions for adaptive bitrate streaming, e.g. final Optional<Transformation.Trim>trim()Useful for images with a solid or nearly solid background and a central object. final Optional<Transformation.UnsharpMask>unsharpMask()Applies Unsharp Masking (USM), an image sharpening technique. final Optional<Transformation.VideoCodec>videoCodec()Specifies the video codec, e.g. final Optional<Transformation.Width>width()Specifies the width of the output. final Optional<Transformation.X>x()Focus using cropped image coordinates - X coordinate. final Optional<Transformation.XCenter>xCenter()Focus using cropped image coordinates - X center coordinate. final Optional<Transformation.Y>y()Focus using cropped image coordinates - Y coordinate. final Optional<Transformation.YCenter>yCenter()Focus using cropped image coordinates - Y center coordinate. final Optional<Double>zoom()Accepts a numeric value that determines how much to zoom in or out of the cropped area. final JsonField<String>_aiChangeBackground()Returns the raw JSON value of aiChangeBackground. final JsonField<Transformation.AiDropShadow>_aiDropShadow()Returns the raw JSON value of aiDropShadow. final JsonField<String>_aiEdit()Returns the raw JSON value of aiEdit. final JsonField<Transformation.AiRemoveBackground>_aiRemoveBackground()Returns the raw JSON value of aiRemoveBackground. final JsonField<Transformation.AiRemoveBackgroundExternal>_aiRemoveBackgroundExternal()Returns the raw JSON value of aiRemoveBackgroundExternal. final JsonField<Transformation.AiRetouch>_aiRetouch()Returns the raw JSON value of aiRetouch. final JsonField<Transformation.AiUpscale>_aiUpscale()Returns the raw JSON value of aiUpscale. final JsonField<Transformation.AiVariation>_aiVariation()Returns the raw JSON value of aiVariation. final JsonField<Transformation.AspectRatio>_aspectRatio()Returns the raw JSON value of aspectRatio. final JsonField<Transformation.AudioCodec>_audioCodec()Returns the raw JSON value of audioCodec. final JsonField<String>_background()Returns the raw JSON value of background. final JsonField<Double>_blur()Returns the raw JSON value of blur. final JsonField<String>_border()Returns the raw JSON value of border. final JsonField<String>_colorize()Returns the raw JSON value of colorize. final JsonField<Boolean>_colorProfile()Returns the raw JSON value of colorProfile. final JsonField<String>_colorReplace()Returns the raw JSON value of colorReplace. final JsonField<Transformation.ContrastStretch>_contrastStretch()Returns the raw JSON value of contrastStretch. final JsonField<Transformation.Crop>_crop()Returns the raw JSON value of crop. final JsonField<Transformation.CropMode>_cropMode()Returns the raw JSON value of cropMode. final JsonField<String>_defaultImage()Returns the raw JSON value of defaultImage. final JsonField<String>_distort()Returns the raw JSON value of distort. final JsonField<Double>_dpr()Returns the raw JSON value of dpr. final JsonField<Transformation.Duration>_duration()Returns the raw JSON value of duration. final JsonField<Transformation.EndOffset>_endOffset()Returns the raw JSON value of endOffset. final JsonField<Transformation.Flip>_flip()Returns the raw JSON value of flip. final JsonField<String>_focus()Returns the raw JSON value of focus. final JsonField<Transformation.Format>_format()Returns the raw JSON value of format. final JsonField<Transformation.Gradient>_gradient()Returns the raw JSON value of gradient. final JsonField<Transformation.Grayscale>_grayscale()Returns the raw JSON value of grayscale. final JsonField<Transformation.Height>_height()Returns the raw JSON value of height. final JsonField<Boolean>_lossless()Returns the raw JSON value of lossless. final JsonField<Boolean>_metadata()Returns the raw JSON value of metadata. final JsonField<String>_named()Returns the raw JSON value of named. final JsonField<Double>_opacity()Returns the raw JSON value of opacity. final JsonField<Boolean>_original()Returns the raw JSON value of original. final JsonField<Overlay>_overlay()Returns the raw JSON value of overlay. final JsonField<Transformation.Page>_page()Returns the raw JSON value of page. final JsonField<Boolean>_progressive()Returns the raw JSON value of progressive. final JsonField<Double>_quality()Returns the raw JSON value of quality. final JsonField<Transformation.Radius>_radius()Returns the raw JSON value of radius. final JsonField<String>_raw()Returns the raw JSON value of raw. final JsonField<Transformation.Rotation>_rotation()Returns the raw JSON value of rotation. final JsonField<Transformation.Shadow>_shadow()Returns the raw JSON value of shadow. final JsonField<Transformation.Sharpen>_sharpen()Returns the raw JSON value of sharpen. final JsonField<Transformation.StartOffset>_startOffset()Returns the raw JSON value of startOffset. final JsonField<List<StreamingResolution>>_streamingResolutions()Returns the raw JSON value of streamingResolutions. final JsonField<Transformation.Trim>_trim()Returns the raw JSON value of trim. final JsonField<Transformation.UnsharpMask>_unsharpMask()Returns the raw JSON value of unsharpMask. final JsonField<Transformation.VideoCodec>_videoCodec()Returns the raw JSON value of videoCodec. final JsonField<Transformation.Width>_width()Returns the raw JSON value of width. final JsonField<Transformation.X>_x()Returns the raw JSON value of x. final JsonField<Transformation.XCenter>_xCenter()Returns the raw JSON value of xCenter. final JsonField<Transformation.Y>_y()Returns the raw JSON value of y. final JsonField<Transformation.YCenter>_yCenter()Returns the raw JSON value of yCenter. final JsonField<Double>_zoom()Returns the raw JSON value of zoom. final Map<String, JsonValue>_additionalProperties()final Transformation.BuildertoBuilder()final Transformationvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static Transformation.Builderbuilder()Returns a mutable builder for constructing an instance of Transformation. -
-
Method Detail
-
aiChangeBackground
final Optional<String> aiChangeBackground()
Uses AI to change the background. Provide a text prompt or a base64-encoded prompt, e.g.,
prompt-snow roadorprompte-[urlencoded_base64_encoded_text]. Not supported inside overlay. See AI Change Background.
-
aiDropShadow
final Optional<Transformation.AiDropShadow> aiDropShadow()
Adds an AI-based drop shadow around a foreground object on a transparent or removed background. Optionally, control the direction, elevation, and saturation of the light source (e.g.,
az-45to change light direction). Passtruefor the default drop shadow, or provide a string for a custom drop shadow. Supported inside overlay. See AI Drop Shadow.
-
aiEdit
final Optional<String> aiEdit()
Uses AI to edit images based on a text prompt. Provide a text prompt or a base64-encoded prompt, e.g.,
prompt-snow roadorprompte-[urlencoded_base64_encoded_text]. Not supported inside overlay. See AI Edit.
-
aiRemoveBackground
final Optional<Transformation.AiRemoveBackground> aiRemoveBackground()
Applies ImageKit's in-house background removal. Supported inside overlay. See AI Background Removal.
-
aiRemoveBackgroundExternal
final Optional<Transformation.AiRemoveBackgroundExternal> aiRemoveBackgroundExternal()
Uses third-party background removal. Note: It is recommended to use aiRemoveBackground, ImageKit's in-house solution, which is more cost-effective. Supported inside overlay. See External Background Removal.
-
aiRetouch
final Optional<Transformation.AiRetouch> aiRetouch()
Performs AI-based retouching to improve faces or product shots. Not supported inside overlay. See AI Retouch.
-
aiUpscale
final Optional<Transformation.AiUpscale> aiUpscale()
Upscales images beyond their original dimensions using AI. Not supported inside overlay. See AI Upscale.
-
aiVariation
final Optional<Transformation.AiVariation> aiVariation()
Generates a variation of an image using AI. This produces a new image with slight variations from the original, such as changes in color, texture, and other visual elements, while preserving the structure and essence of the original image. Not supported inside overlay. See AI Generate Variations.
-
aspectRatio
final Optional<Transformation.AspectRatio> aspectRatio()
Specifies the aspect ratio for the output, e.g., "ar-4-3". Typically used with either width or height (but not both). For example: aspectRatio =
4:3,4_3, or an expression likeiar_div_2. See Image resize and crop – Aspect ratio.
-
audioCodec
final Optional<Transformation.AudioCodec> audioCodec()
Specifies the audio codec, e.g.,
aac,opus, ornone. See Audio codec.
-
background
final Optional<String> background()
Specifies the background to be used in conjunction with certain cropping strategies when resizing an image.
A solid color: e.g.,
red,F3F3F3,AAFF0010. See Solid color background.Dominant color:
dominantextracts the dominant color from the image. See Dominant color background.Gradient:
gradient_dominantorgradient_dominant_2creates a gradient using the dominant colors. Optionally specify palette size (2 or 4), e.g.,gradient_dominant_4. See Gradient background.A blurred background: e.g.,
blurred,blurred_25_N15, etc. See Blurred background.Expand the image boundaries using generative fill:
genfill. Not supported inside overlay. Optionally, control the background scene by passing a text prompt:genfill[:-prompt-${text}]orgenfill[:-prompte-${urlencoded_base64_encoded_text}]. See Generative fill background.
-
blur
final Optional<Double> blur()
Specifies the Gaussian blur level. Accepts an integer value between 1 and 100, or an expression like
bl-10. See Blur.
-
border
final Optional<String> border()
Adds a border to the output media. Accepts a string in the format
<border-width>_<hex-code>(e.g.,5_FFF000for a 5px yellow border), or an expression likeih_div_20_FF00FF. See Border.
-
colorize
final Optional<String> colorize()
Applies a color tint to the image. Accepts color and intensity as optional parameters.
co-color- Color to apply (e.g.,red,blue,FF0022). Default is gray color.in-intensity- Intensity of the color (0-100). Default is 35. See Colorize.
-
colorProfile
final Optional<Boolean> colorProfile()
Indicates whether the output image should retain the original color profile. See Color profile.
-
colorReplace
final Optional<String> colorReplace()
Replaces colors in the image. Supports three formats:
toColor- Replace dominant color with the specified color.toColor_tolerance- Replace dominant color with specified tolerance (0-100).toColor_tolerance_fromColor- Replace a specific color with another within tolerance range. Colors can be hex codes (e.g.,FF0022) or names (e.g.,red,blue). See Color replacement.
-
contrastStretch
final Optional<Transformation.ContrastStretch> contrastStretch()
Automatically enhances the contrast of an image (contrast stretch). See Contrast Stretch.
-
crop
final Optional<Transformation.Crop> crop()
Crop modes for image resizing. See Crop modes & focus.
-
cropMode
final Optional<Transformation.CropMode> cropMode()
Additional crop modes for image resizing. See Crop modes & focus.
-
defaultImage
final Optional<String> defaultImage()
Specifies a fallback image if the resource is not found, e.g., a URL or file path. See Default image.
-
distort
final Optional<String> distort()
Distorts the shape of an image. Supports two modes:
Perspective distortion:
p-x1_y1_x2_y2_x3_y3_x4_y4changes the position of the four corners starting clockwise from top-left.Arc distortion:
a-degreescurves the image upwards (positive values) or downwards (negative values). See Distort effect.
-
dpr
final Optional<Double> dpr()
Accepts values between 0.1 and 5, or
autofor automatic device pixel ratio (DPR) calculation. Also accepts arithmetic expressions.Learn about Arithmetic expressions.
See DPR.
-
duration
final Optional<Transformation.Duration> duration()
Specifies the duration (in seconds) for trimming videos, e.g.,
5or10.5. Typically used with startOffset to indicate the length from the start offset. Arithmetic expressions are supported. See Trim videos – Duration.
-
endOffset
final Optional<Transformation.EndOffset> endOffset()
Specifies the end offset (in seconds) for trimming videos, e.g.,
5or10.5. Typically used with startOffset to define a time window. Arithmetic expressions are supported. See Trim videos – End offset.
-
flip
final Optional<Transformation.Flip> flip()
Flips or mirrors an image either horizontally, vertically, or both. Acceptable values:
h(horizontal),v(vertical),h_v(horizontal and vertical), orv_h. See Flip.
-
focus
final Optional<String> focus()
Refines padding and cropping behavior for pad resize, maintain ratio, and extract crop modes. Supports manual positions and coordinate-based focus. With AI-based cropping, you can automatically keep key subjects in frame—such as faces or detected objects (e.g.,
fo-face,fo-person,fo-car)— while resizing.See Focus.
[Object aware
-
format
final Optional<Transformation.Format> format()
Specifies the output format for images or videos, e.g.,
jpg,png,webp,mp4, orauto. You can also passorigfor images to return the original format. ImageKit automatically delivers images and videos in the optimal format based on device support unless overridden by the dashboard settings or the format parameter. See Image format and Video format.
-
gradient
final Optional<Transformation.Gradient> gradient()
Creates a linear gradient with two colors. Pass
truefor a default gradient, or provide a string for a custom gradient. See Gradient.
-
grayscale
final Optional<Transformation.Grayscale> grayscale()
Enables a grayscale effect for images. See Grayscale.
-
height
final Optional<Transformation.Height> height()
Specifies the height of the output. If a value between 0 and 1 is provided, it is treated as a percentage (e.g.,
0.5represents 50% of the original height). You can also supply arithmetic expressions (e.g.,ih_mul_0.5). Height transformation – Images · Videos
-
lossless
final Optional<Boolean> lossless()
Specifies whether the output image (in JPEG or PNG) should be compressed losslessly. See Lossless compression.
-
metadata
final Optional<Boolean> metadata()
By default, ImageKit removes all metadata during automatic image compression. Set this to true to preserve metadata. See Image metadata.
-
named
final Optional<String> named()
Named transformation reference. See Named transformations.
-
opacity
final Optional<Double> opacity()
Specifies the opacity level of the output image. See Opacity.
-
original
final Optional<Boolean> original()
If set to true, serves the original file without applying any transformations. See Deliver original file as-is.
-
overlay
final Optional<Overlay> overlay()
Specifies an overlay to be applied on the parent image or video. ImageKit supports overlays including images, text, videos, subtitles, and solid colors. See Overlay using layers.
-
page
final Optional<Transformation.Page> page()
Extracts a specific page or frame from multi-page or layered files (PDF, PSD, AI). For example, specify by number (e.g.,
2), a range (e.g.,3-4for the 2nd and 3rd layers), or by name (e.g.,name-layer-4for a PSD layer). See Thumbnail extraction.
-
progressive
final Optional<Boolean> progressive()
Specifies whether the output JPEG image should be rendered progressively. Progressive loading begins with a low-quality, pixelated version of the full image, which gradually improves to provide a faster perceived load time. See Progressive images.
-
quality
final Optional<Double> quality()
Specifies the quality of the output image for lossy formats such as JPEG, WebP, and AVIF. A higher quality value results in a larger file size with better quality, while a lower value produces a smaller file size with reduced quality. See Quality.
-
radius
final Optional<Transformation.Radius> radius()
Specifies the corner radius for rounded corners.
Single value (positive integer): Applied to all corners (e.g.,
20).max: Creates a circular or oval shape.Per-corner array: Provide four underscore-separated values representing top-left, top-right, bottom-right, and bottom-left corners respectively (e.g.,
10_20_30_40). See Radius.
-
raw
final Optional<String> raw()
Pass any transformation not directly supported by the SDK. This transformation string is appended to the URL as provided.
-
rotation
final Optional<Transformation.Rotation> rotation()
Specifies the rotation angle in degrees. Positive values rotate the image clockwise; you can also use, for example,
N40for counterclockwise rotation orautoto use the orientation specified in the image's EXIF data. For videos, only the following values are supported: 0, 90, 180, 270, or 360. See Rotate.
-
shadow
final Optional<Transformation.Shadow> shadow()
Adds a shadow beneath solid objects in an image with a transparent background. For AI-based drop shadows, refer to aiDropShadow. Pass
truefor a default shadow, or provide a string for a custom shadow. See Shadow.
-
sharpen
final Optional<Transformation.Sharpen> sharpen()
Sharpens the input image, highlighting edges and finer details. Pass
truefor default sharpening, or provide a numeric value for custom sharpening. See Sharpen.
-
startOffset
final Optional<Transformation.StartOffset> startOffset()
Specifies the start offset (in seconds) for trimming videos, e.g.,
5or10.5. Arithmetic expressions are also supported. See Trim videos – Start offset.
-
streamingResolutions
final Optional<List<StreamingResolution>> streamingResolutions()
An array of resolutions for adaptive bitrate streaming, e.g., `240`, `360`, `480`, `720`, `1080`. See Adaptive Bitrate Streaming.
-
trim
final Optional<Transformation.Trim> trim()
Useful for images with a solid or nearly solid background and a central object. This parameter trims the background, leaving only the central object in the output image. See Trim edges.
-
unsharpMask
final Optional<Transformation.UnsharpMask> unsharpMask()
Applies Unsharp Masking (USM), an image sharpening technique. Pass
truefor a default unsharp mask, or provide a string for a custom unsharp mask. See Unsharp Mask.
-
videoCodec
final Optional<Transformation.VideoCodec> videoCodec()
Specifies the video codec, e.g.,
h264,vp9,av1, ornone. See Video codec.
-
width
final Optional<Transformation.Width> width()
Specifies the width of the output. If a value between 0 and 1 is provided, it is treated as a percentage (e.g.,
0.4represents 40% of the original width). You can also supply arithmetic expressions (e.g.,iw_div_2). Width transformation – Images · Videos
-
x
final Optional<Transformation.X> x()
Focus using cropped image coordinates - X coordinate. See Focus using cropped coordinates.
-
xCenter
final Optional<Transformation.XCenter> xCenter()
Focus using cropped image coordinates - X center coordinate. See Focus using cropped coordinates.
-
y
final Optional<Transformation.Y> y()
Focus using cropped image coordinates - Y coordinate. See Focus using cropped coordinates.
-
yCenter
final Optional<Transformation.YCenter> yCenter()
Focus using cropped image coordinates - Y center coordinate. See Focus using cropped coordinates.
-
zoom
final Optional<Double> zoom()
Accepts a numeric value that determines how much to zoom in or out of the cropped area. It should be used in conjunction with fo-face or fo-<object_name>. See Zoom.
-
_aiChangeBackground
final JsonField<String> _aiChangeBackground()
Returns the raw JSON value of aiChangeBackground.
Unlike aiChangeBackground, this method doesn't throw if the JSON field has an unexpected type.
-
_aiDropShadow
final JsonField<Transformation.AiDropShadow> _aiDropShadow()
Returns the raw JSON value of aiDropShadow.
Unlike aiDropShadow, this method doesn't throw if the JSON field has an unexpected type.
-
_aiEdit
final JsonField<String> _aiEdit()
Returns the raw JSON value of aiEdit.
Unlike aiEdit, this method doesn't throw if the JSON field has an unexpected type.
-
_aiRemoveBackground
final JsonField<Transformation.AiRemoveBackground> _aiRemoveBackground()
Returns the raw JSON value of aiRemoveBackground.
Unlike aiRemoveBackground, this method doesn't throw if the JSON field has an unexpected type.
-
_aiRemoveBackgroundExternal
final JsonField<Transformation.AiRemoveBackgroundExternal> _aiRemoveBackgroundExternal()
Returns the raw JSON value of aiRemoveBackgroundExternal.
Unlike aiRemoveBackgroundExternal, this method doesn't throw if the JSON field has an unexpected type.
-
_aiRetouch
final JsonField<Transformation.AiRetouch> _aiRetouch()
Returns the raw JSON value of aiRetouch.
Unlike aiRetouch, this method doesn't throw if the JSON field has an unexpected type.
-
_aiUpscale
final JsonField<Transformation.AiUpscale> _aiUpscale()
Returns the raw JSON value of aiUpscale.
Unlike aiUpscale, this method doesn't throw if the JSON field has an unexpected type.
-
_aiVariation
final JsonField<Transformation.AiVariation> _aiVariation()
Returns the raw JSON value of aiVariation.
Unlike aiVariation, this method doesn't throw if the JSON field has an unexpected type.
-
_aspectRatio
final JsonField<Transformation.AspectRatio> _aspectRatio()
Returns the raw JSON value of aspectRatio.
Unlike aspectRatio, this method doesn't throw if the JSON field has an unexpected type.
-
_audioCodec
final JsonField<Transformation.AudioCodec> _audioCodec()
Returns the raw JSON value of audioCodec.
Unlike audioCodec, this method doesn't throw if the JSON field has an unexpected type.
-
_background
final JsonField<String> _background()
Returns the raw JSON value of background.
Unlike background, this method doesn't throw if the JSON field has an unexpected type.
-
_blur
final JsonField<Double> _blur()
Returns the raw JSON value of blur.
Unlike blur, this method doesn't throw if the JSON field has an unexpected type.
-
_border
final JsonField<String> _border()
Returns the raw JSON value of border.
Unlike border, this method doesn't throw if the JSON field has an unexpected type.
-
_colorize
final JsonField<String> _colorize()
Returns the raw JSON value of colorize.
Unlike colorize, this method doesn't throw if the JSON field has an unexpected type.
-
_colorProfile
final JsonField<Boolean> _colorProfile()
Returns the raw JSON value of colorProfile.
Unlike colorProfile, this method doesn't throw if the JSON field has an unexpected type.
-
_colorReplace
final JsonField<String> _colorReplace()
Returns the raw JSON value of colorReplace.
Unlike colorReplace, this method doesn't throw if the JSON field has an unexpected type.
-
_contrastStretch
final JsonField<Transformation.ContrastStretch> _contrastStretch()
Returns the raw JSON value of contrastStretch.
Unlike contrastStretch, this method doesn't throw if the JSON field has an unexpected type.
-
_crop
final JsonField<Transformation.Crop> _crop()
Returns the raw JSON value of crop.
Unlike crop, this method doesn't throw if the JSON field has an unexpected type.
-
_cropMode
final JsonField<Transformation.CropMode> _cropMode()
Returns the raw JSON value of cropMode.
Unlike cropMode, this method doesn't throw if the JSON field has an unexpected type.
-
_defaultImage
final JsonField<String> _defaultImage()
Returns the raw JSON value of defaultImage.
Unlike defaultImage, this method doesn't throw if the JSON field has an unexpected type.
-
_distort
final JsonField<String> _distort()
Returns the raw JSON value of distort.
Unlike distort, this method doesn't throw if the JSON field has an unexpected type.
-
_dpr
final JsonField<Double> _dpr()
Returns the raw JSON value of dpr.
Unlike dpr, this method doesn't throw if the JSON field has an unexpected type.
-
_duration
final JsonField<Transformation.Duration> _duration()
Returns the raw JSON value of duration.
Unlike duration, this method doesn't throw if the JSON field has an unexpected type.
-
_endOffset
final JsonField<Transformation.EndOffset> _endOffset()
Returns the raw JSON value of endOffset.
Unlike endOffset, this method doesn't throw if the JSON field has an unexpected type.
-
_flip
final JsonField<Transformation.Flip> _flip()
Returns the raw JSON value of flip.
Unlike flip, this method doesn't throw if the JSON field has an unexpected type.
-
_focus
final JsonField<String> _focus()
Returns the raw JSON value of focus.
Unlike focus, this method doesn't throw if the JSON field has an unexpected type.
-
_format
final JsonField<Transformation.Format> _format()
Returns the raw JSON value of format.
Unlike format, this method doesn't throw if the JSON field has an unexpected type.
-
_gradient
final JsonField<Transformation.Gradient> _gradient()
Returns the raw JSON value of gradient.
Unlike gradient, this method doesn't throw if the JSON field has an unexpected type.
-
_grayscale
final JsonField<Transformation.Grayscale> _grayscale()
Returns the raw JSON value of grayscale.
Unlike grayscale, this method doesn't throw if the JSON field has an unexpected type.
-
_height
final JsonField<Transformation.Height> _height()
Returns the raw JSON value of height.
Unlike height, this method doesn't throw if the JSON field has an unexpected type.
-
_lossless
final JsonField<Boolean> _lossless()
Returns the raw JSON value of lossless.
Unlike lossless, this method doesn't throw if the JSON field has an unexpected type.
-
_metadata
final JsonField<Boolean> _metadata()
Returns the raw JSON value of metadata.
Unlike metadata, this method doesn't throw if the JSON field has an unexpected type.
-
_named
final JsonField<String> _named()
Returns the raw JSON value of named.
Unlike named, this method doesn't throw if the JSON field has an unexpected type.
-
_opacity
final JsonField<Double> _opacity()
Returns the raw JSON value of opacity.
Unlike opacity, this method doesn't throw if the JSON field has an unexpected type.
-
_original
final JsonField<Boolean> _original()
Returns the raw JSON value of original.
Unlike original, this method doesn't throw if the JSON field has an unexpected type.
-
_overlay
final JsonField<Overlay> _overlay()
Returns the raw JSON value of overlay.
Unlike overlay, this method doesn't throw if the JSON field has an unexpected type.
-
_page
final JsonField<Transformation.Page> _page()
Returns the raw JSON value of page.
Unlike page, this method doesn't throw if the JSON field has an unexpected type.
-
_progressive
final JsonField<Boolean> _progressive()
Returns the raw JSON value of progressive.
Unlike progressive, this method doesn't throw if the JSON field has an unexpected type.
-
_quality
final JsonField<Double> _quality()
Returns the raw JSON value of quality.
Unlike quality, this method doesn't throw if the JSON field has an unexpected type.
-
_radius
final JsonField<Transformation.Radius> _radius()
Returns the raw JSON value of radius.
Unlike radius, this method doesn't throw if the JSON field has an unexpected type.
-
_raw
final JsonField<String> _raw()
Returns the raw JSON value of raw.
Unlike raw, this method doesn't throw if the JSON field has an unexpected type.
-
_rotation
final JsonField<Transformation.Rotation> _rotation()
Returns the raw JSON value of rotation.
Unlike rotation, this method doesn't throw if the JSON field has an unexpected type.
-
_shadow
final JsonField<Transformation.Shadow> _shadow()
Returns the raw JSON value of shadow.
Unlike shadow, this method doesn't throw if the JSON field has an unexpected type.
-
_sharpen
final JsonField<Transformation.Sharpen> _sharpen()
Returns the raw JSON value of sharpen.
Unlike sharpen, this method doesn't throw if the JSON field has an unexpected type.
-
_startOffset
final JsonField<Transformation.StartOffset> _startOffset()
Returns the raw JSON value of startOffset.
Unlike startOffset, this method doesn't throw if the JSON field has an unexpected type.
-
_streamingResolutions
final JsonField<List<StreamingResolution>> _streamingResolutions()
Returns the raw JSON value of streamingResolutions.
Unlike streamingResolutions, this method doesn't throw if the JSON field has an unexpected type.
-
_trim
final JsonField<Transformation.Trim> _trim()
Returns the raw JSON value of trim.
Unlike trim, this method doesn't throw if the JSON field has an unexpected type.
-
_unsharpMask
final JsonField<Transformation.UnsharpMask> _unsharpMask()
Returns the raw JSON value of unsharpMask.
Unlike unsharpMask, this method doesn't throw if the JSON field has an unexpected type.
-
_videoCodec
final JsonField<Transformation.VideoCodec> _videoCodec()
Returns the raw JSON value of videoCodec.
Unlike videoCodec, this method doesn't throw if the JSON field has an unexpected type.
-
_width
final JsonField<Transformation.Width> _width()
Returns the raw JSON value of width.
Unlike width, this method doesn't throw if the JSON field has an unexpected type.
-
_x
final JsonField<Transformation.X> _x()
Returns the raw JSON value of x.
Unlike x, this method doesn't throw if the JSON field has an unexpected type.
-
_xCenter
final JsonField<Transformation.XCenter> _xCenter()
Returns the raw JSON value of xCenter.
Unlike xCenter, this method doesn't throw if the JSON field has an unexpected type.
-
_y
final JsonField<Transformation.Y> _y()
Returns the raw JSON value of y.
Unlike y, this method doesn't throw if the JSON field has an unexpected type.
-
_yCenter
final JsonField<Transformation.YCenter> _yCenter()
Returns the raw JSON value of yCenter.
Unlike yCenter, this method doesn't throw if the JSON field has an unexpected type.
-
_zoom
final JsonField<Double> _zoom()
Returns the raw JSON value of zoom.
Unlike zoom, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final Transformation.Builder toBuilder()
-
validate
final Transformation validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
builder
final static Transformation.Builder builder()
Returns a mutable builder for constructing an instance of Transformation.
-
-
-
-