Media auto scale
This script will automatically scale the media to its original layer size. This is useful for adapting a dynamic image or video of a different size to match the original media dimensions.
These are the options for the media auto scale script:
- Fill - scales the media to fill the original layer size.
- Fixed ratio - will keep the aspect ratio of the media asset (recommended).
- Transform size - set custom size of the layer in pixels.
- Transform positions - set custom position of the layer in pixels, relative to the composition of the layer.
Applying the fill
setting will make sure that the media layer will fill the entire original layer size. Now, this can be a problem if you have a portrait image, and you want to fit it into a landscape composition, because the media layer will get stretched. In that case, you can use the fixedRatio
setting, which will keep the aspect ratio of the media layer. We suggest using the fixedRatio
setting always, as it will make sure that the media layer is always kept in the correct aspect ratio.
If fixedRatio
is used on its own, the media layer will be scaled to fit the original layer size (vertically or horizontally), but it will not fill the entire layer size, instead it will result in a letterbox effect.
If you want to set a custom size of the media layer, you can use the transform.size
setting, and set the size of width and height in pixels. This can be useful if you want all of your assets to be the same size, for example 1920x1080.
You can not use the transform.size
and fill
or fixedRatio
at the same time, as transform.size
is strict size
that you will provide, while fill
and fixedRatio
depend on provided image / video and original layer size.
If you want to set a custom position and move the media layer, you can use the transform.position
setting, and set the coordinates of the position in pixels. This can be useful if you want to position the media layer in a specific place in the composition. This setting can be used in combination with all other settings.
There are two ways of using this script:
- When applying parametrization to the layer (dynamic or static), you can check the box next to Auto scale, and we will automatically apply the script to that layer, with
fill
andfixedRatio
enabled. - You can add the script manually to the layer, by navigating to the Scripting tab, and selecting the Auto scale media script.
To learn more about how media auto-scaling works and how it’s implemented in your project, check the Image / video scaling section.