Class: Imagekitio::Models::Transformation

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/imagekitio/models/transformation.rb

Defined Under Namespace

Modules: AIDropShadow, AIRemoveBackground, AIRemoveBackgroundExternal, AIRetouch, AIUpscale, AIVariation, AspectRatio, AudioCodec, ContrastStretch, Crop, CropMode, Duration, EndOffset, Flip, Format, Gradient, Grayscale, Height, Page, Radius, Rotation, Shadow, Sharpen, StartOffset, Trim, UnsharpMask, VideoCodec, Width, X, XCenter, Y, YCenter

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(ai_change_background: nil, ai_drop_shadow: nil, ai_edit: nil, ai_remove_background: nil, ai_remove_background_external: nil, ai_retouch: nil, ai_upscale: nil, ai_variation: nil, aspect_ratio: nil, audio_codec: nil, background: nil, blur: nil, border: nil, color_profile: nil, contrast_stretch: nil, crop: nil, crop_mode: nil, default_image: nil, dpr: nil, duration: nil, end_offset: nil, flip: nil, focus: nil, format_: nil, gradient: nil, grayscale: nil, height: nil, lossless: nil, metadata: nil, named: nil, opacity: nil, original: nil, overlay: nil, page: nil, progressive: nil, quality: nil, radius: nil, raw: nil, rotation: nil, shadow: nil, sharpen: nil, start_offset: nil, streaming_resolutions: nil, trim: nil, unsharp_mask: nil, video_codec: nil, width: nil, x: nil, x_center: nil, y_: nil, y_center: nil, zoom: nil) ⇒ Object

Some parameter documentations has been truncated, see Imagekitio::Models::Transformation for more details.

The 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 ‘raw` parameter to pass the transformation string directly. See the [Transformations documentation](imagekit.io/docs/transformations).

Parameters:

  • ai_change_background (String) (defaults to: nil)

    Uses AI to change the background. Provide a text prompt or a base64-encoded prom

  • ai_drop_shadow (Boolean, true, String) (defaults to: nil)

    Adds an AI-based drop shadow around a foreground object on a transparent or remo

  • ai_edit (String) (defaults to: nil)

    Uses AI to edit images based on a text prompt. Provide a text prompt or a base64

  • ai_remove_background (Boolean, Imagekitio::Models::Transformation::AIRemoveBackground) (defaults to: nil)

    Applies ImageKit’s in-house background removal.

  • ai_remove_background_external (Boolean, Imagekitio::Models::Transformation::AIRemoveBackgroundExternal) (defaults to: nil)

    Uses third-party background removal.

  • ai_retouch (Boolean, Imagekitio::Models::Transformation::AIRetouch) (defaults to: nil)

    Performs AI-based retouching to improve faces or product shots. Not supported in

  • ai_upscale (Boolean, Imagekitio::Models::Transformation::AIUpscale) (defaults to: nil)

    Upscales images beyond their original dimensions using AI. Not supported inside

  • ai_variation (Boolean, Imagekitio::Models::Transformation::AIVariation) (defaults to: nil)

    Generates a variation of an image using AI. This produces a new image with sligh

  • aspect_ratio (Float, String) (defaults to: nil)

    Specifies the aspect ratio for the output, e.g., “ar-4-3”. Typically used with e

  • audio_codec (Symbol, Imagekitio::Models::Transformation::AudioCodec) (defaults to: nil)

    Specifies the audio codec, e.g., ‘aac`, `opus`, or `none`. See [Audio codec](htt

  • background (String) (defaults to: nil)

    Specifies the background to be used in conjunction with certain cropping strateg

  • blur (Float) (defaults to: nil)

    Specifies the Gaussian blur level. Accepts an integer value between 1 and 100, o

  • border (String) (defaults to: nil)

    Adds a border to the output media. Accepts a string in the format ‘<border-width

  • color_profile (Boolean) (defaults to: nil)

    Indicates whether the output image should retain the original color profile.

  • contrast_stretch (Boolean, Imagekitio::Models::Transformation::ContrastStretch) (defaults to: nil)

    Automatically enhances the contrast of an image (contrast stretch).

  • crop (Symbol, Imagekitio::Models::Transformation::Crop) (defaults to: nil)

    Crop modes for image resizing. See [Crop modes & focus](imagekit.io/docs

  • crop_mode (Symbol, Imagekitio::Models::Transformation::CropMode) (defaults to: nil)

    Additional crop modes for image resizing. See [Crop modes & focus](image

  • default_image (String) (defaults to: nil)

    Specifies a fallback image if the resource is not found, e.g., a URL or file pat

  • dpr (Float) (defaults to: nil)

    Accepts values between 0.1 and 5, or ‘auto` for automatic device pixel ratio (DP

  • duration (Float, String) (defaults to: nil)

    Specifies the duration (in seconds) for trimming videos, e.g., ‘5` or `10.5`.

  • end_offset (Float, String) (defaults to: nil)

    Specifies the end offset (in seconds) for trimming videos, e.g., ‘5` or `10.5`.

  • flip (Symbol, Imagekitio::Models::Transformation::Flip) (defaults to: nil)

    Flips or mirrors an image either horizontally, vertically, or both.

  • focus (String) (defaults to: nil)

    Refines padding and cropping behavior for pad resize, maintain ratio, and extrac

  • format_ (Symbol, Imagekitio::Models::Transformation::Format) (defaults to: nil)

    Specifies the output format for images or videos, e.g., ‘jpg`, `png`, `webp`, `m

  • gradient (Boolean, true, String) (defaults to: nil)

    Creates a linear gradient with two colors. Pass ‘true` for a default gradient, o

  • grayscale (Boolean, Imagekitio::Models::Transformation::Grayscale) (defaults to: nil)

    Enables a grayscale effect for images. See [Grayscale](imagekit.io/docs/

  • height (Float, String) (defaults to: nil)

    Specifies the height of the output. If a value between 0 and 1 is provided, it i

  • lossless (Boolean) (defaults to: nil)

    Specifies whether the output image (in JPEG or PNG) should be compressed lossles

  • metadata (Boolean) (defaults to: nil)

    By default, ImageKit removes all metadata during automatic image compression.

  • named (String) (defaults to: nil)

    Named transformation reference. See [Named transformations](imagekit.io/

  • opacity (Float) (defaults to: nil)

    Specifies the opacity level of the output image. See [Opacity](imagekit.

  • original (Boolean) (defaults to: nil)

    If set to true, serves the original file without applying any transformations.

  • overlay (Imagekitio::Models::Overlay) (defaults to: nil)

    Specifies an overlay to be applied on the parent image or video.

  • page (Float, String) (defaults to: nil)

    Extracts a specific page or frame from multi-page or layered files (PDF, PSD, AI

  • progressive (Boolean) (defaults to: nil)

    Specifies whether the output JPEG image should be rendered progressively. Progre

  • quality (Float) (defaults to: nil)

    Specifies the quality of the output image for lossy formats such as JPEG, WebP,

  • radius (Float, Symbol, :max) (defaults to: nil)

    Specifies the corner radius for rounded corners (e.g., 20) or ‘max` for circular

  • raw (String) (defaults to: nil)

    Pass any transformation not directly supported by the SDK.

  • rotation (Float, String) (defaults to: nil)

    Specifies the rotation angle in degrees. Positive values rotate the image clockw

  • shadow (Boolean, true, String) (defaults to: nil)

    Adds a shadow beneath solid objects in an image with a transparent background.

  • sharpen (Boolean, true, Float) (defaults to: nil)

    Sharpens the input image, highlighting edges and finer details.

  • start_offset (Float, String) (defaults to: nil)

    Specifies the start offset (in seconds) for trimming videos, e.g., ‘5` or `10.5`

  • streaming_resolutions (Array<Symbol, Imagekitio::Models::StreamingResolution>) (defaults to: nil)

    An array of resolutions for adaptive bitrate streaming, e.g., [‘240`, `360`, `48

  • trim (Boolean, true, Float) (defaults to: nil)

    Useful for images with a solid or nearly solid background and a central object.

  • unsharp_mask (Boolean, true, String) (defaults to: nil)

    Applies Unsharp Masking (USM), an image sharpening technique.

  • video_codec (Symbol, Imagekitio::Models::Transformation::VideoCodec) (defaults to: nil)

    Specifies the video codec, e.g., ‘h264`, `vp9`, `av1`, or `none`. See [Video cod

  • width (Float, String) (defaults to: nil)

    Specifies the width of the output. If a value between 0 and 1 is provided, it is

  • x (Float, String) (defaults to: nil)

    Focus using cropped image coordinates - X coordinate. See [Focus using cropped c

  • x_center (Float, String) (defaults to: nil)

    Focus using cropped image coordinates - X center coordinate. See [Focus using cr

  • y_ (Float, String) (defaults to: nil)

    Focus using cropped image coordinates - Y coordinate. See [Focus using cropped c

  • y_center (Float, String) (defaults to: nil)

    Focus using cropped image coordinates - Y center coordinate. See [Focus using cr

  • zoom (Float) (defaults to: nil)

    Accepts a numeric value that determines how much to zoom in or out of the croppe



# File 'lib/imagekitio/models/transformation.rb', line 462


Instance Attribute Details

#ai_change_backgroundString?

Uses AI to change the background. Provide a text prompt or a base64-encoded prompt, e.g., ‘prompt-snow road` or `prompte-`. Not supported inside overlay. See [AI Change Background](imagekit.io/docs/ai-transformations#change-background-e-changebg).

Returns:

  • (String, nil)


13
# File 'lib/imagekitio/models/transformation.rb', line 13

optional :ai_change_background, String, api_name: :aiChangeBackground

#ai_drop_shadowBoolean, ...

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-45` to change light direction). Pass `true` for the default drop shadow, or provide a string for a custom drop shadow. Supported inside overlay. See [AI Drop Shadow](imagekit.io/docs/ai-transformations#ai-drop-shadow-e-dropshadow).

Returns:

  • (Boolean, true, String, nil)


24
25
26
27
28
# File 'lib/imagekitio/models/transformation.rb', line 24

optional :ai_drop_shadow,
union: -> {
  Imagekitio::Transformation::AIDropShadow
},
api_name: :aiDropShadow

#ai_editString?

Uses AI to edit images based on a text prompt. Provide a text prompt or a base64-encoded prompt, e.g., ‘prompt-snow road` or `prompte-`. Not supported inside overlay. See [AI Edit](imagekit.io/docs/ai-transformations#edit-image-e-edit).

Returns:

  • (String, nil)


37
# File 'lib/imagekitio/models/transformation.rb', line 37

optional :ai_edit, String, api_name: :aiEdit

#ai_remove_backgroundBoolean, ...

Applies ImageKit’s in-house background removal. Supported inside overlay. See [AI Background Removal](imagekit.io/docs/ai-transformations#imagekit-background-removal-e-bgremove).



44
45
46
# File 'lib/imagekitio/models/transformation.rb', line 44

optional :ai_remove_background,
enum: -> { Imagekitio::Transformation::AIRemoveBackground },
api_name: :aiRemoveBackground

#ai_remove_background_externalBoolean, ...

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](imagekit.io/docs/ai-transformations#background-removal-e-removedotbg).



55
56
57
# File 'lib/imagekitio/models/transformation.rb', line 55

optional :ai_remove_background_external,
enum: -> { Imagekitio::Transformation::AIRemoveBackgroundExternal },
api_name: :aiRemoveBackgroundExternal

#ai_retouchBoolean, ...

Performs AI-based retouching to improve faces or product shots. Not supported inside overlay. See [AI Retouch](imagekit.io/docs/ai-transformations#retouch-e-retouch).



65
# File 'lib/imagekitio/models/transformation.rb', line 65

optional :ai_retouch, enum: -> { Imagekitio::Transformation::AIRetouch }, api_name: :aiRetouch

#ai_upscaleBoolean, ...

Upscales images beyond their original dimensions using AI. Not supported inside overlay. See [AI Upscale](imagekit.io/docs/ai-transformations#upscale-e-upscale).



73
# File 'lib/imagekitio/models/transformation.rb', line 73

optional :ai_upscale, enum: -> { Imagekitio::Transformation::AIUpscale }, api_name: :aiUpscale

#ai_variationBoolean, ...

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](imagekit.io/docs/ai-transformations#generate-variations-of-an-image-e-genvar).



83
# File 'lib/imagekitio/models/transformation.rb', line 83

optional :ai_variation, enum: -> { Imagekitio::Transformation::AIVariation }, api_name: :aiVariation

#aspect_ratioFloat, ...

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 like `iar_div_2`. See [Image resize and crop – Aspect ratio](imagekit.io/docs/image-resize-and-crop#aspect-ratio—ar).

Returns:

  • (Float, String, nil)


92
# File 'lib/imagekitio/models/transformation.rb', line 92

optional :aspect_ratio, union: -> { Imagekitio::Transformation::AspectRatio }, api_name: :aspectRatio

#audio_codecSymbol, ...

Specifies the audio codec, e.g., ‘aac`, `opus`, or `none`. See [Audio codec](imagekit.io/docs/video-optimization#audio-codec—ac).



99
# File 'lib/imagekitio/models/transformation.rb', line 99

optional :audio_codec, enum: -> { Imagekitio::Transformation::AudioCodec }, api_name: :audioCodec

#backgroundString?

Specifies the background to be used in conjunction with certain cropping strategies when resizing an image.

Returns:

  • (String, nil)


116
# File 'lib/imagekitio/models/transformation.rb', line 116

optional :background, String

#blurFloat?

Specifies the Gaussian blur level. Accepts an integer value between 1 and 100, or an expression like ‘bl-10`. See [Blur](imagekit.io/docs/effects-and-enhancements#blur—bl).

Returns:

  • (Float, nil)


124
# File 'lib/imagekitio/models/transformation.rb', line 124

optional :blur, Float

#borderString?

Adds a border to the output media. Accepts a string in the format ‘<border-width>_<hex-code>` (e.g., `5_FFF000` for a 5px yellow border), or an expression like `ih_div_20_FF00FF`. See [Border](imagekit.io/docs/effects-and-enhancements#border—b).

Returns:

  • (String, nil)


133
# File 'lib/imagekitio/models/transformation.rb', line 133

optional :border, String

#color_profileBoolean?

Indicates whether the output image should retain the original color profile. See [Color profile](imagekit.io/docs/image-optimization#color-profile—cp).

Returns:

  • (Boolean, nil)


140
# File 'lib/imagekitio/models/transformation.rb', line 140

optional :color_profile, Imagekitio::Internal::Type::Boolean, api_name: :colorProfile

#contrast_stretchBoolean, ...

Automatically enhances the contrast of an image (contrast stretch). See [Contrast Stretch](imagekit.io/docs/effects-and-enhancements#contrast-stretch—e-contrast).



147
148
149
# File 'lib/imagekitio/models/transformation.rb', line 147

optional :contrast_stretch,
enum: -> { Imagekitio::Transformation::ContrastStretch },
api_name: :contrastStretch

#cropSymbol, ...

Crop modes for image resizing. See [Crop modes & focus](imagekit.io/docs/image-resize-and-crop#crop-crop-modes–focus).



156
# File 'lib/imagekitio/models/transformation.rb', line 156

optional :crop, enum: -> { Imagekitio::Transformation::Crop }

#crop_modeSymbol, ...

Additional crop modes for image resizing. See [Crop modes & focus](imagekit.io/docs/image-resize-and-crop#crop-crop-modes–focus).



163
# File 'lib/imagekitio/models/transformation.rb', line 163

optional :crop_mode, enum: -> { Imagekitio::Transformation::CropMode }, api_name: :cropMode

#default_imageString?

Specifies a fallback image if the resource is not found, e.g., a URL or file path. See [Default image](imagekit.io/docs/image-transformation#default-image—di).

Returns:

  • (String, nil)


171
# File 'lib/imagekitio/models/transformation.rb', line 171

optional :default_image, String, api_name: :defaultImage

#dprFloat?

Accepts values between 0.1 and 5, or ‘auto` for automatic device pixel ratio (DPR) calculation. See [DPR](imagekit.io/docs/image-resize-and-crop#dpr—dpr).

Returns:

  • (Float, nil)


179
# File 'lib/imagekitio/models/transformation.rb', line 179

optional :dpr, Float

#durationFloat, ...

Specifies the duration (in seconds) for trimming videos, e.g., ‘5` or `10.5`. Typically used with startOffset to indicate the length from the start offset. Arithmetic expressions are supported. See [Trim videos – Duration](imagekit.io/docs/trim-videos#duration—du).

Returns:

  • (Float, String, nil)


188
# File 'lib/imagekitio/models/transformation.rb', line 188

optional :duration, union: -> { Imagekitio::Transformation::Duration }

#end_offsetFloat, ...

Specifies the end offset (in seconds) for trimming videos, e.g., ‘5` or `10.5`. Typically used with startOffset to define a time window. Arithmetic expressions are supported. See [Trim videos – End offset](imagekit.io/docs/trim-videos#end-offset—eo).

Returns:

  • (Float, String, nil)


197
# File 'lib/imagekitio/models/transformation.rb', line 197

optional :end_offset, union: -> { Imagekitio::Transformation::EndOffset }, api_name: :endOffset

#flipSymbol, ...

Flips or mirrors an image either horizontally, vertically, or both. Acceptable values: ‘h` (horizontal), `v` (vertical), `h_v` (horizontal and vertical), or `v_h`. See [Flip](imagekit.io/docs/effects-and-enhancements#flip—fl).



205
# File 'lib/imagekitio/models/transformation.rb', line 205

optional :flip, enum: -> { Imagekitio::Transformation::Flip }

#focusString?

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.

Returns:

  • (String, nil)


218
# File 'lib/imagekitio/models/transformation.rb', line 218

optional :focus, String

#format_Symbol, ...

Specifies the output format for images or videos, e.g., ‘jpg`, `png`, `webp`, `mp4`, or `auto`. You can also pass `orig` for 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](imagekit.io/docs/image-optimization#format—f) and [Video format](imagekit.io/docs/video-optimization#format—f).



230
# File 'lib/imagekitio/models/transformation.rb', line 230

optional :format_, enum: -> { Imagekitio::Transformation::Format }, api_name: :format

#gradientBoolean, ...

Creates a linear gradient with two colors. Pass ‘true` for a default gradient, or provide a string for a custom gradient. See [Gradient](imagekit.io/docs/effects-and-enhancements#gradient—e-gradient).

Returns:

  • (Boolean, true, String, nil)


238
# File 'lib/imagekitio/models/transformation.rb', line 238

optional :gradient, union: -> { Imagekitio::Transformation::Gradient }

#grayscaleBoolean, ...

Enables a grayscale effect for images. See [Grayscale](imagekit.io/docs/effects-and-enhancements#grayscale—e-grayscale).



245
# File 'lib/imagekitio/models/transformation.rb', line 245

optional :grayscale, enum: -> { Imagekitio::Transformation::Grayscale }

#heightFloat, ...

Specifies the height of the output. If a value between 0 and 1 is provided, it is treated as a percentage (e.g., ‘0.5` represents 50% of the original height). You can also supply arithmetic expressions (e.g., `ih_mul_0.5`). Height transformation –[Images](imagekit.io/docs/image-resize-and-crop#height—h) ·[Videos](imagekit.io/docs/video-resize-and-crop#height—h)

Returns:

  • (Float, String, nil)


256
# File 'lib/imagekitio/models/transformation.rb', line 256

optional :height, union: -> { Imagekitio::Transformation::Height }

#losslessBoolean?

Specifies whether the output image (in JPEG or PNG) should be compressed losslessly. See [Lossless compression](imagekit.io/docs/image-optimization#lossless-webp-and-png—lo).

Returns:

  • (Boolean, nil)


264
# File 'lib/imagekitio/models/transformation.rb', line 264

optional :lossless, Imagekitio::Internal::Type::Boolean

#metadataBoolean?

By default, ImageKit removes all metadata during automatic image compression. Set this to true to preserve metadata. See [Image metadata](imagekit.io/docs/image-optimization#image-metadata—md).

Returns:

  • (Boolean, nil)


272
# File 'lib/imagekitio/models/transformation.rb', line 272

optional :metadata, Imagekitio::Internal::Type::Boolean

#namedString?

Named transformation reference. See [Named transformations](imagekit.io/docs/transformations#named-transformations).

Returns:

  • (String, nil)


279
# File 'lib/imagekitio/models/transformation.rb', line 279

optional :named, String

#opacityFloat?

Specifies the opacity level of the output image. See [Opacity](imagekit.io/docs/effects-and-enhancements#opacity—o).

Returns:

  • (Float, nil)


286
# File 'lib/imagekitio/models/transformation.rb', line 286

optional :opacity, Float

#originalBoolean?

If set to true, serves the original file without applying any transformations. See [Deliver original file as-is](imagekit.io/docs/core-delivery-features#deliver-original-file-as-is—orig-true).

Returns:

  • (Boolean, nil)


294
# File 'lib/imagekitio/models/transformation.rb', line 294

optional :original, Imagekitio::Internal::Type::Boolean

#overlayImagekitio::Models::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](imagekit.io/docs/transformations#overlay-using-layers).

Returns:



303
# File 'lib/imagekitio/models/transformation.rb', line 303

optional :overlay, union: -> { Imagekitio::Overlay }

#pageFloat, ...

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-4` for the 2nd and 3rd layers), or by name (e.g., `name-layer-4` for a PSD layer). See [Thumbnail extraction](imagekit.io/docs/vector-and-animated-images#get-thumbnail-from-psd-pdf-ai-eps-and-animated-files).

Returns:

  • (Float, String, nil)


312
# File 'lib/imagekitio/models/transformation.rb', line 312

optional :page, union: -> { Imagekitio::Transformation::Page }

#progressiveBoolean?

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](imagekit.io/docs/image-optimization#progressive-image—pr).

Returns:

  • (Boolean, nil)


321
# File 'lib/imagekitio/models/transformation.rb', line 321

optional :progressive, Imagekitio::Internal::Type::Boolean

#qualityFloat?

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](imagekit.io/docs/image-optimization#quality—q).

Returns:

  • (Float, nil)


330
# File 'lib/imagekitio/models/transformation.rb', line 330

optional :quality, Float

#radiusFloat, ...

Specifies the corner radius for rounded corners (e.g., 20) or ‘max` for circular or oval shape. See [Radius](imagekit.io/docs/effects-and-enhancements#radius—r).

Returns:

  • (Float, Symbol, :max, nil)


338
# File 'lib/imagekitio/models/transformation.rb', line 338

optional :radius, union: -> { Imagekitio::Transformation::Radius }

#rawString?

Pass any transformation not directly supported by the SDK. This transformation string is appended to the URL as provided.

Returns:

  • (String, nil)


345
# File 'lib/imagekitio/models/transformation.rb', line 345

optional :raw, String

#rotationFloat, ...

Specifies the rotation angle in degrees. Positive values rotate the image clockwise; you can also use, for example, ‘N40` for counterclockwise rotation or `auto` to 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](imagekit.io/docs/effects-and-enhancements#rotate—rt).

Returns:

  • (Float, String, nil)


355
# File 'lib/imagekitio/models/transformation.rb', line 355

optional :rotation, union: -> { Imagekitio::Transformation::Rotation }

#shadowBoolean, ...

Adds a shadow beneath solid objects in an image with a transparent background. For AI-based drop shadows, refer to aiDropShadow. Pass ‘true` for a default shadow, or provide a string for a custom shadow. See [Shadow](imagekit.io/docs/effects-and-enhancements#shadow—e-shadow).

Returns:

  • (Boolean, true, String, nil)


364
# File 'lib/imagekitio/models/transformation.rb', line 364

optional :shadow, union: -> { Imagekitio::Transformation::Shadow }

#sharpenBoolean, ...

Sharpens the input image, highlighting edges and finer details. Pass ‘true` for default sharpening, or provide a numeric value for custom sharpening. See [Sharpen](imagekit.io/docs/effects-and-enhancements#sharpen—e-sharpen).

Returns:

  • (Boolean, true, Float, nil)


372
# File 'lib/imagekitio/models/transformation.rb', line 372

optional :sharpen, union: -> { Imagekitio::Transformation::Sharpen }

#start_offsetFloat, ...

Specifies the start offset (in seconds) for trimming videos, e.g., ‘5` or `10.5`. Arithmetic expressions are also supported. See [Trim videos – Start offset](imagekit.io/docs/trim-videos#start-offset—so).

Returns:

  • (Float, String, nil)


380
# File 'lib/imagekitio/models/transformation.rb', line 380

optional :start_offset, union: -> { Imagekitio::Transformation::StartOffset }, api_name: :startOffset

#streaming_resolutionsArray<Symbol, Imagekitio::Models::StreamingResolution>?

An array of resolutions for adaptive bitrate streaming, e.g., [‘240`, `360`, `480`, `720`, `1080`]. See [Adaptive Bitrate Streaming](imagekit.io/docs/adaptive-bitrate-streaming).

Returns:



388
389
390
# File 'lib/imagekitio/models/transformation.rb', line 388

optional :streaming_resolutions,
-> { Imagekitio::Internal::Type::ArrayOf[enum: Imagekitio::StreamingResolution] },
api_name: :streamingResolutions

#trimBoolean, ...

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](imagekit.io/docs/effects-and-enhancements#trim-edges—t).

Returns:

  • (Boolean, true, Float, nil)


399
# File 'lib/imagekitio/models/transformation.rb', line 399

optional :trim, union: -> { Imagekitio::Transformation::Trim }

#unsharp_maskBoolean, ...

Applies Unsharp Masking (USM), an image sharpening technique. Pass ‘true` for a default unsharp mask, or provide a string for a custom unsharp mask. See [Unsharp Mask](imagekit.io/docs/effects-and-enhancements#unsharp-mask—e-usm).

Returns:

  • (Boolean, true, String, nil)


407
# File 'lib/imagekitio/models/transformation.rb', line 407

optional :unsharp_mask, union: -> { Imagekitio::Transformation::UnsharpMask }, api_name: :unsharpMask

#video_codecSymbol, ...

Specifies the video codec, e.g., ‘h264`, `vp9`, `av1`, or `none`. See [Video codec](imagekit.io/docs/video-optimization#video-codec—vc).



414
# File 'lib/imagekitio/models/transformation.rb', line 414

optional :video_codec, enum: -> { Imagekitio::Transformation::VideoCodec }, api_name: :videoCodec

#widthFloat, ...

Specifies the width of the output. If a value between 0 and 1 is provided, it is treated as a percentage (e.g., ‘0.4` represents 40% of the original width). You can also supply arithmetic expressions (e.g., `iw_div_2`). Width transformation – [Images](imagekit.io/docs/image-resize-and-crop#width—w) ·[Videos](imagekit.io/docs/video-resize-and-crop#width—w)

Returns:

  • (Float, String, nil)


424
# File 'lib/imagekitio/models/transformation.rb', line 424

optional :width, union: -> { Imagekitio::Transformation::Width }

#xFloat, ...

Focus using cropped image coordinates - X coordinate. See [Focus using cropped coordinates](imagekit.io/docs/image-resize-and-crop#example—focus-using-cropped-image-coordinates).

Returns:

  • (Float, String, nil)


431
# File 'lib/imagekitio/models/transformation.rb', line 431

optional :x, union: -> { Imagekitio::Transformation::X }

#x_centerFloat, ...

Focus using cropped image coordinates - X center coordinate. See [Focus using cropped coordinates](imagekit.io/docs/image-resize-and-crop#example—focus-using-cropped-image-coordinates).

Returns:

  • (Float, String, nil)


438
# File 'lib/imagekitio/models/transformation.rb', line 438

optional :x_center, union: -> { Imagekitio::Transformation::XCenter }, api_name: :xCenter

#y_Float, ...

Focus using cropped image coordinates - Y coordinate. See [Focus using cropped coordinates](imagekit.io/docs/image-resize-and-crop#example—focus-using-cropped-image-coordinates).

Returns:

  • (Float, String, nil)


445
# File 'lib/imagekitio/models/transformation.rb', line 445

optional :y_, union: -> { Imagekitio::Transformation::Y }, api_name: :y

#y_centerFloat, ...

Focus using cropped image coordinates - Y center coordinate. See [Focus using cropped coordinates](imagekit.io/docs/image-resize-and-crop#example—focus-using-cropped-image-coordinates).

Returns:

  • (Float, String, nil)


452
# File 'lib/imagekitio/models/transformation.rb', line 452

optional :y_center, union: -> { Imagekitio::Transformation::YCenter }, api_name: :yCenter

#zoomFloat?

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](imagekit.io/docs/image-resize-and-crop#zoom—z).

Returns:

  • (Float, nil)


460
# File 'lib/imagekitio/models/transformation.rb', line 460

optional :zoom, Float

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/imagekitio/models/transformation.rb', line 605


.variantsArray(Float, String)

Returns:

  • (Array(Float, String))


# File 'lib/imagekitio/models/transformation.rb', line 592