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, color_replace: nil, contrast_stretch: nil, crop: nil, crop_mode: nil, default_image: nil, distort: 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:

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

    Applies ImageKit’s in-house background removal.

  • (defaults to: nil)

    Uses third-party background removal.

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

    Replaces colors in the image. Supports three formats:

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

    Distorts the shape of an image. Supports two modes:

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

    Specifies the corner radius for rounded corners.

  • (defaults to: nil)

    Pass any transformation not directly supported by the SDK.

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

    Sharpens the input image, highlighting edges and finer details.

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (defaults to: nil)

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

  • (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 501


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-[urlencoded_base64_encoded_text]. Not supported inside overlay. See [AI Change Background](imagekit.io/docs/ai-transformations#change-background-e-changebg).

Returns:



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:



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-[urlencoded_base64_encoded_text]. Not supported inside overlay. See [AI Edit](imagekit.io/docs/ai-transformations#edit-image-e-edit).

Returns:



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).

Returns:



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).

Returns:



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).

Returns:



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).

Returns:



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).

Returns:



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:



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).

Returns:



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:



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

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:



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

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:



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

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:



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

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

#color_replaceString?

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](imagekit.io/docs/effects-and-enhancements#color-replace—cr).

Returns:



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

optional :color_replace, String, api_name: :colorReplace

#contrast_stretchBoolean, ...

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

Returns:



166
167
168
# File 'lib/imagekitio/models/transformation.rb', line 166

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).

Returns:



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

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).

Returns:



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

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:



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

optional :default_image, String, api_name: :defaultImage

#distortString?

Distorts the shape of an image. Supports two modes:

  • Perspective distortion: p-x1_y1_x2_y2_x3_y3_x4_y4 changes the position of the four corners starting clockwise from top-left.

  • Arc distortion: a-degrees curves the image upwards (positive values) or downwards (negative values). See [Distort effect](imagekit.io/docs/effects-and-enhancements#distort—e-distort).

Returns:



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

optional :distort, String

#dprFloat?

Accepts values between 0.1 and 5, or auto for automatic device pixel ratio (DPR) calculation. Also accepts arithmetic expressions.

Returns:



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

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:



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

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:



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

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).

Returns:



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

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:



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

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).

Returns:



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

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:



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

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

#grayscaleBoolean, ...

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

Returns:



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

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:



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

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:



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

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:



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

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

#namedString?

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

Returns:



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

optional :named, String

#opacityFloat?

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

Returns:



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

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:



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

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:



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

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:



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

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:



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

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:



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

optional :quality, Float

#radiusFloat, ...

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

Returns:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



427
428
429
# File 'lib/imagekitio/models/transformation.rb', line 427

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:



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

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:



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

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).

Returns:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

optional :zoom, Float

Class Method Details

.valuesArray<Symbol>

Returns:



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


.variantsArray(Float, String)

Returns:



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