Background - (bg)
It is used to specify the background when using crop-mode pad_resize or border-radius (r). The background can be any solid color or blurred frame of the video.
Default value - By default, the background is black.
Solid color background
- RGB Hex code: A 6-digit hex code (eg.
AAFF00
,0f0fac
). - RGBA Hex code: An 8-digit hex code. Last two characters must be a number between
00
and99
, specifying the opacity level (eg.AAFF0040
,0f0fac75
), - Color name: A standard color name in lowercase (eg. lightgreen, beige),
Blurred background
Syntax: blurred[_<BlurIntensity>][_<Brightness>]
Parameter | Value | Description | Default |
---|---|---|---|
Blur intensity | auto or an integer from 0 to 100 | Set the intensity of blur | 'auto' |
Brightness | Integer from N255 to 255 | Negative value to make background darker and positive value to make the background lighter | 0 |
Limitation: Blurred background can only be used with cm-pad_resize
Blur intensity auto
: The intensity of blur is automatically adjusted based on the provided height (h) & width (w) in the transformation.
URL - https://ik.imagekit.io/demo/tr:h-700,w-700,cm-pad_resize,bg-blurred_25_N55/sample2.mp4
Customize blur-intensity to '25' & brightness to 'N55' (Make background darker)
URL - https://ik.imagekit.io/demo/tr:h-700,w-700,cm-pad_resize,bg-blurred_auto_30/sample2.mp4
Automatic blur-intensity & customize brightness to '30' (Make background lighter)
Border - (b)
This adds a border to the video. It accepts two parameters - the width of the border and the color of the border.
Usage - b-<border-width>_<hex code>
The width is specified as a number which is equivalent to the border width in pixels. The color code is specified as a 6-character hex code RRGGBB.
You can also provide an arithmetic expression such as ih_div_20_red
, or cw_mul_0.05_FF00FF
as a value for this parameter. Doing so will first calculate the value of the width and then apply transformations using that value. Learn more about arithmetic expressions here.
Radius - (r)
Get a video with a rounded corner. Control the radius of the corner using this parameter. To get a circle or oval shape, set the value to max
.
Usage - r-<value>
Possible values - Any positive integer or max
.
You can also change the background color of the video from the default black color using the background parameter.
If the input asset has 1:1 aspect ratio, using max
will result in a circle shape. However, if the input asset is rectangular, using max
will result in an oval shape.
URL - https://ik.imagekit.io/ikmedia/sample-video.mp4?tr=r-max
Rotate - (rt)
It is used to specify the degree by which the output video must be rotated.
Possible values - 0
, 90
, 180
, 270
and 360
.