Add IMG parameters to GetObject requests to process images stored in OSS. You can resize, crop, watermark, convert formats, and more.
IMG parameters
Process images with one or more parameters, or group parameters into a style for batch processing. Image styles.
When you specify multiple IMG parameters, OSS processes the image in the specified order.
|
Actions |
Parameter |
Description |
|
resize |
Resizes the image to specified dimensions. |
|
|
watermark |
Adds an image or text watermark to the image. |
|
|
crop |
Crops the image into a rectangle of a specified size. |
|
|
quality |
Adjusts the quality of JPG and WebP images. |
|
|
format |
Converts the image format. |
|
|
format |
Converts the image to a high-compression format, such as HEIF or AVIF. |
|
|
info |
Retrieves image information, such as basic properties and Exchangeable Image File Format (EXIF) data. |
|
|
auto-orient |
Automatically rotates an image based on its orientation metadata. |
|
|
circle |
Crops a circular image of a specified size, centered on the original image. |
|
|
indexcrop |
Slices the image into sections along the x-axis or y-axis and selects one of the slices. |
|
|
rounded-corners |
Crops the image into a rectangle with rounded corners of a specified radius. |
|
|
blur |
Applies a blur effect to the image. |
|
|
rotate |
Rotates the image clockwise by a specified angle. |
|
|
interlace |
Enables progressive rendering for an image in JPG format. |
|
|
average-hue |
Retrieves the average hue of the image. |
|
|
bright |
Adjusts the brightness of the image. |
|
|
sharpen |
Applies a sharpening effect to the image. |
|
|
contrast |
Adjusts the contrast of the image. |
For example, adding resize and quality parameters to example.jpg produces the URL https://oss-console-img-demo-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/example.jpg?x-oss-process=image/resize,w_300/quality,q_90. You can configure CDN to retrieve either the source or processed image during back-to-origin requests.
-
Back-to-origin for the source image
With parameter filtering enabled, CDN strips all parameters after the question mark (?) and fetches the source image
example.jpg. -
Back-to-origin for the processed image
With parameter preservation, CDN retains the URL parameters and fetches the processed image.
Configure CDN back-to-origin rules with Ignore parameters.
IMG methods
Process images using object URLs, API operations, or SDKs. Image processing methods.
Limitations
|
Item |
Description |
|
Image formats |
|
|
Image size |
Maximum source image size: 20 MB. |
|
Source image dimensions |
Rotation: maximum width or height is 4,096 px. Other operations: maximum width or height is 30,000 px, with a total pixel limit of 250 million. The total number of pixels for dynamic images, such as GIF images, is |
|
Target image dimensions |
|
|
Image resizing |
After resizing, the width or height cannot exceed 16,384 px, and total pixels cannot exceed 16,777,216. |
|
Image styles |
Maximum: 50 image styles per bucket. To request more, submit a ticket. Note
A single image style can include multiple IMG parameters for complex operations. Image styles. |
|
Processing capacity |
Note
For computationally intensive scenarios (encoding WebP, AVIF, or HEIF above 1080p) or workloads exceeding these limits, contact technical support to evaluate limits for your use case. |
Billing
IMG incurs the following fees:
-
Request fees
Each operation generates one GetObject request, incurring a per-request fee. Request fees.
-
Traffic fees
Outbound traffic fees are based on processed image size. Traffic fees.
IMG versions
IMG has both a new and old API version. This document covers the new version; the old version is no longer updated. New and old versions of IMG and their compatibility.