This operation first scales an image to a specified size based on its shorter edge. Then, it fills the remaining empty area with a specified color.
Parameters
Name | Description | Valid values |
w | The width of the target thumbnail. | 1 to 4096 |
h | The height of the target thumbnail. | 1 to 4096 |
e | The scaling priority edge. This parameter must be set to 4. | 4 |
bgc | The background color for filling. The default color is white. Format: | Red, green, blue: 0 to 255 |
Notes
If you do not specify a format, the source image is converted to the JPG format by default. This conversion may cause distortion if the source image is in the PNG, WebP, or BMP format. For more information, see Quality transformations and Format conversions.
The bgc parameter specifies the color using RGB values.
Examples
Scale an image to 100 × 100 based on its shorter edge.
https://oss-console-img-demo-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/example.jpg@100w_100h_4e

The default background color is white because no color is specified.
Scale an image to 100 × 100 based on its shorter edge and fill the background with red.
