Class: Imagekitio::Models::Transformation
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Imagekitio::Models::Transformation
- 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
-
#ai_change_background ⇒ String?
Uses AI to change the background.
-
#ai_drop_shadow ⇒ Boolean, ...
Adds an AI-based drop shadow around a foreground object on a transparent or removed background.
-
#ai_edit ⇒ String?
Uses AI to edit images based on a text prompt.
-
#ai_remove_background ⇒ Boolean, ...
Applies ImageKit’s in-house background removal.
-
#ai_remove_background_external ⇒ Boolean, ...
Uses third-party background removal.
-
#ai_retouch ⇒ Boolean, ...
Performs AI-based retouching to improve faces or product shots.
-
#ai_upscale ⇒ Boolean, ...
Upscales images beyond their original dimensions using AI.
-
#ai_variation ⇒ Boolean, ...
Generates a variation of an image using AI.
-
#aspect_ratio ⇒ Float, ...
Specifies the aspect ratio for the output, e.g., “ar-4-3”.
-
#audio_codec ⇒ Symbol, ...
Specifies the audio codec, e.g., ‘aac`, `opus`, or `none`.
-
#background ⇒ String?
Specifies the background to be used in conjunction with certain cropping strategies when resizing an image.
-
#blur ⇒ Float?
Specifies the Gaussian blur level.
-
#border ⇒ String?
Adds a border to the output media.
-
#color_profile ⇒ Boolean?
Indicates whether the output image should retain the original color profile.
-
#contrast_stretch ⇒ Boolean, ...
Automatically enhances the contrast of an image (contrast stretch).
-
#crop ⇒ Symbol, ...
Crop modes for image resizing.
-
#crop_mode ⇒ Symbol, ...
Additional crop modes for image resizing.
-
#default_image ⇒ String?
Specifies a fallback image if the resource is not found, e.g., a URL or file path.
-
#dpr ⇒ Float?
Accepts values between 0.1 and 5, or ‘auto` for automatic device pixel ratio (DPR) calculation.
-
#duration ⇒ Float, ...
Specifies the duration (in seconds) for trimming videos, e.g., ‘5` or `10.5`.
-
#end_offset ⇒ Float, ...
Specifies the end offset (in seconds) for trimming videos, e.g., ‘5` or `10.5`.
-
#flip ⇒ Symbol, ...
Flips or mirrors an image either horizontally, vertically, or both.
-
#focus ⇒ String?
Refines padding and cropping behavior for pad resize, maintain ratio, and extract crop modes.
-
#format_ ⇒ Symbol, ...
Specifies the output format for images or videos, e.g., ‘jpg`, `png`, `webp`, `mp4`, or `auto`.
-
#gradient ⇒ Boolean, ...
Creates a linear gradient with two colors.
-
#grayscale ⇒ Boolean, ...
Enables a grayscale effect for images.
-
#height ⇒ Float, ...
Specifies the height of the output.
-
#lossless ⇒ Boolean?
Specifies whether the output image (in JPEG or PNG) should be compressed losslessly.
-
#metadata ⇒ Boolean?
By default, ImageKit removes all metadata during automatic image compression.
-
#named ⇒ String?
Named transformation reference.
-
#opacity ⇒ Float?
Specifies the opacity level of the output image.
-
#original ⇒ Boolean?
If set to true, serves the original file without applying any transformations.
-
#overlay ⇒ Imagekitio::Models::Overlay?
Specifies an overlay to be applied on the parent image or video.
-
#page ⇒ Float, ...
Extracts a specific page or frame from multi-page or layered files (PDF, PSD, AI).
-
#progressive ⇒ Boolean?
Specifies whether the output JPEG image should be rendered progressively.
-
#quality ⇒ Float?
Specifies the quality of the output image for lossy formats such as JPEG, WebP, and AVIF.
-
#radius ⇒ Float, ...
Specifies the corner radius for rounded corners (e.g., 20) or ‘max` for circular or oval shape.
-
#raw ⇒ String?
Pass any transformation not directly supported by the SDK.
-
#rotation ⇒ Float, ...
Specifies the rotation angle in degrees.
-
#shadow ⇒ Boolean, ...
Adds a shadow beneath solid objects in an image with a transparent background.
-
#sharpen ⇒ Boolean, ...
Sharpens the input image, highlighting edges and finer details.
-
#start_offset ⇒ Float, ...
Specifies the start offset (in seconds) for trimming videos, e.g., ‘5` or `10.5`.
-
#streaming_resolutions ⇒ Array<Symbol, Imagekitio::Models::StreamingResolution>?
An array of resolutions for adaptive bitrate streaming, e.g., [‘240`, `360`, `480`, `720`, `1080`].
-
#trim ⇒ Boolean, ...
Useful for images with a solid or nearly solid background and a central object.
-
#unsharp_mask ⇒ Boolean, ...
Applies Unsharp Masking (USM), an image sharpening technique.
-
#video_codec ⇒ Symbol, ...
Specifies the video codec, e.g., ‘h264`, `vp9`, `av1`, or `none`.
-
#width ⇒ Float, ...
Specifies the width of the output.
-
#x ⇒ Float, ...
Focus using cropped image coordinates - X coordinate.
-
#x_center ⇒ Float, ...
Focus using cropped image coordinates - X center coordinate.
-
#y_ ⇒ Float, ...
Focus using cropped image coordinates - Y coordinate.
-
#y_center ⇒ Float, ...
Focus using cropped image coordinates - Y center coordinate.
-
#zoom ⇒ Float?
Accepts a numeric value that determines how much to zoom in or out of the cropped area.
Class Method Summary collapse
Instance Method Summary collapse
-
#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
constructor
Some parameter documentations has been truncated, see Transformation for more details.
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).
|
|
# File 'lib/imagekitio/models/transformation.rb', line 462
|
Instance Attribute Details
#ai_change_background ⇒ String?
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).
13 |
# File 'lib/imagekitio/models/transformation.rb', line 13 optional :ai_change_background, String, api_name: :aiChangeBackground |
#ai_drop_shadow ⇒ Boolean, ...
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).
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_edit ⇒ String?
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).
37 |
# File 'lib/imagekitio/models/transformation.rb', line 37 optional :ai_edit, String, api_name: :aiEdit |
#ai_remove_background ⇒ Boolean, ...
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_external ⇒ Boolean, ...
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_retouch ⇒ Boolean, ...
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_upscale ⇒ Boolean, ...
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_variation ⇒ Boolean, ...
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_ratio ⇒ Float, ...
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).
92 |
# File 'lib/imagekitio/models/transformation.rb', line 92 optional :aspect_ratio, union: -> { Imagekitio::Transformation::AspectRatio }, api_name: :aspectRatio |
#audio_codec ⇒ Symbol, ...
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 |
#background ⇒ String?
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](imagekit.io/docs/effects-and-enhancements#solid-color-background).
-
A blurred background: e.g., ‘blurred`, `blurred_25_N15`, etc. See [Blurred background](imagekit.io/docs/effects-and-enhancements#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` or `genfill`. See [Generative fill background](imagekit.io/docs/ai-transformations#generative-fill-bg-genfill).
116 |
# File 'lib/imagekitio/models/transformation.rb', line 116 optional :background, String |
#blur ⇒ Float?
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).
124 |
# File 'lib/imagekitio/models/transformation.rb', line 124 optional :blur, Float |
#border ⇒ String?
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).
133 |
# File 'lib/imagekitio/models/transformation.rb', line 133 optional :border, String |
#color_profile ⇒ Boolean?
Indicates whether the output image should retain the original color profile. See [Color profile](imagekit.io/docs/image-optimization#color-profile—cp).
140 |
# File 'lib/imagekitio/models/transformation.rb', line 140 optional :color_profile, Imagekitio::Internal::Type::Boolean, api_name: :colorProfile |
#contrast_stretch ⇒ Boolean, ...
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 |
#crop ⇒ Symbol, ...
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_mode ⇒ Symbol, ...
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_image ⇒ String?
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).
171 |
# File 'lib/imagekitio/models/transformation.rb', line 171 optional :default_image, String, api_name: :defaultImage |
#dpr ⇒ Float?
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).
179 |
# File 'lib/imagekitio/models/transformation.rb', line 179 optional :dpr, Float |
#duration ⇒ Float, ...
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).
188 |
# File 'lib/imagekitio/models/transformation.rb', line 188 optional :duration, union: -> { Imagekitio::Transformation::Duration } |
#end_offset ⇒ Float, ...
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).
197 |
# File 'lib/imagekitio/models/transformation.rb', line 197 optional :end_offset, union: -> { Imagekitio::Transformation::EndOffset }, api_name: :endOffset |
#flip ⇒ Symbol, ...
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 } |
#focus ⇒ String?
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](imagekit.io/docs/image-resize-and-crop#focus—fo).
-
[Object aware cropping](imagekit.io/docs/image-resize-and-crop#object-aware-cropping—fo-object-name)
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 |
#gradient ⇒ Boolean, ...
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).
238 |
# File 'lib/imagekitio/models/transformation.rb', line 238 optional :gradient, union: -> { Imagekitio::Transformation::Gradient } |
#grayscale ⇒ Boolean, ...
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 } |
#height ⇒ Float, ...
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)
256 |
# File 'lib/imagekitio/models/transformation.rb', line 256 optional :height, union: -> { Imagekitio::Transformation::Height } |
#lossless ⇒ Boolean?
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).
264 |
# File 'lib/imagekitio/models/transformation.rb', line 264 optional :lossless, Imagekitio::Internal::Type::Boolean |
#metadata ⇒ Boolean?
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).
272 |
# File 'lib/imagekitio/models/transformation.rb', line 272 optional :metadata, Imagekitio::Internal::Type::Boolean |
#named ⇒ String?
Named transformation reference. See [Named transformations](imagekit.io/docs/transformations#named-transformations).
279 |
# File 'lib/imagekitio/models/transformation.rb', line 279 optional :named, String |
#opacity ⇒ Float?
Specifies the opacity level of the output image. See [Opacity](imagekit.io/docs/effects-and-enhancements#opacity—o).
286 |
# File 'lib/imagekitio/models/transformation.rb', line 286 optional :opacity, Float |
#original ⇒ Boolean?
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).
294 |
# File 'lib/imagekitio/models/transformation.rb', line 294 optional :original, Imagekitio::Internal::Type::Boolean |
#overlay ⇒ Imagekitio::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).
303 |
# File 'lib/imagekitio/models/transformation.rb', line 303 optional :overlay, union: -> { Imagekitio::Overlay } |
#page ⇒ Float, ...
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).
312 |
# File 'lib/imagekitio/models/transformation.rb', line 312 optional :page, union: -> { Imagekitio::Transformation::Page } |
#progressive ⇒ Boolean?
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).
321 |
# File 'lib/imagekitio/models/transformation.rb', line 321 optional :progressive, Imagekitio::Internal::Type::Boolean |
#quality ⇒ Float?
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).
330 |
# File 'lib/imagekitio/models/transformation.rb', line 330 optional :quality, Float |
#radius ⇒ Float, ...
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).
338 |
# File 'lib/imagekitio/models/transformation.rb', line 338 optional :radius, union: -> { Imagekitio::Transformation::Radius } |
#raw ⇒ String?
Pass any transformation not directly supported by the SDK. This transformation string is appended to the URL as provided.
345 |
# File 'lib/imagekitio/models/transformation.rb', line 345 optional :raw, String |
#rotation ⇒ Float, ...
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).
355 |
# File 'lib/imagekitio/models/transformation.rb', line 355 optional :rotation, union: -> { Imagekitio::Transformation::Rotation } |
#shadow ⇒ Boolean, ...
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).
364 |
# File 'lib/imagekitio/models/transformation.rb', line 364 optional :shadow, union: -> { Imagekitio::Transformation::Shadow } |
#sharpen ⇒ Boolean, ...
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).
372 |
# File 'lib/imagekitio/models/transformation.rb', line 372 optional :sharpen, union: -> { Imagekitio::Transformation::Sharpen } |
#start_offset ⇒ Float, ...
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).
380 |
# File 'lib/imagekitio/models/transformation.rb', line 380 optional :start_offset, union: -> { Imagekitio::Transformation::StartOffset }, api_name: :startOffset |
#streaming_resolutions ⇒ Array<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).
388 389 390 |
# File 'lib/imagekitio/models/transformation.rb', line 388 optional :streaming_resolutions, -> { Imagekitio::Internal::Type::ArrayOf[enum: Imagekitio::StreamingResolution] }, api_name: :streamingResolutions |
#trim ⇒ Boolean, ...
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).
399 |
# File 'lib/imagekitio/models/transformation.rb', line 399 optional :trim, union: -> { Imagekitio::Transformation::Trim } |
#unsharp_mask ⇒ Boolean, ...
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).
407 |
# File 'lib/imagekitio/models/transformation.rb', line 407 optional :unsharp_mask, union: -> { Imagekitio::Transformation::UnsharpMask }, api_name: :unsharpMask |
#video_codec ⇒ Symbol, ...
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 |
#width ⇒ Float, ...
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)
424 |
# File 'lib/imagekitio/models/transformation.rb', line 424 optional :width, union: -> { Imagekitio::Transformation::Width } |
#x ⇒ Float, ...
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).
431 |
# File 'lib/imagekitio/models/transformation.rb', line 431 optional :x, union: -> { Imagekitio::Transformation::X } |
#x_center ⇒ Float, ...
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).
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).
445 |
# File 'lib/imagekitio/models/transformation.rb', line 445 optional :y_, union: -> { Imagekitio::Transformation::Y }, api_name: :y |
#y_center ⇒ Float, ...
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).
452 |
# File 'lib/imagekitio/models/transformation.rb', line 452 optional :y_center, union: -> { Imagekitio::Transformation::YCenter }, api_name: :yCenter |
#zoom ⇒ Float?
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).
460 |
# File 'lib/imagekitio/models/transformation.rb', line 460 optional :zoom, Float |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/imagekitio/models/transformation.rb', line 605
|
.variants ⇒ Array(Float, String)
|
|
# File 'lib/imagekitio/models/transformation.rb', line 592
|