Image processing

更新时间: 2026-04-18 10:35:13

You can enable features like automatic conversion to WebP, automatic rotation (auto-orientation only), and automatic compression directly in the Alibaba Cloud CDN console. For more advanced transformations, such as cropping or adding watermarks, you can add image editing parameters to the request URL.

Note
  • The image editing features of Alibaba Cloud CDN, DCDN, and OSS are independent and cannot be used interchangeably.

  • Image editing is a paid service. During the public preview, this feature is available free of charge. You will be notified before billing starts.

  • When you use the image editing feature, converting between different image formats, such as from JPEG to WebP, JPEG to PNG, or PNG to WebP, may increase the file size. This is because of significant differences in their compression algorithms. If you need to reduce the file size, we recommend that you lower the image quality by using the quality parameter.

Enable image editing

  1. Log on to the CDN console.

  2. In the left navigation pane, click Domain Names.

  3. On the Domain Names page, find the target domain name and click Manage in the Actions column.

  4. In the domain's navigation pane, click Optimization.

  5. In the Image Editing section, turn on Image Editing and select the image formats that you want to convert.

    Note
    • After you select the supported image formats and enable the feature, the image editing parameters in a URL take effect when you process images by using file URLs.

    • You can decide whether to enable automatic conversion to WebP, automatic rotation (auto-orientation only), and automatic compression in the console based on your business needs.

    picture_process-cn.jpg

    Parameter

    Description

    Supported Image Formats

    Select the image formats to convert. This parameter is required, and you can select multiple formats.

    Automatic Conversion to WebP

    After you enable this feature, Alibaba Cloud CDN checks the Accept header of the request. If the header contains image/webp, images in other formats are automatically converted to the WebP format and then cached.

    Note

    Enabling this feature may cause a temporary drop in the cache hit ratio. The ratio will return to normal after a short period. Do not enable this feature during peak business hours.

    Automatic Rotation

    Enables automatic orientation correction for images.

    Note
    • Automatic rotation applies only to images that have the auto-orient parameter.

    • Enabling this feature may cause a temporary drop in the cache hit ratio. The ratio will return to normal after a short period. Do not enable this feature during peak business hours.

    Automatic Compression

    When enabled (disabled by default), this feature compresses images to reduce traffic without changing their resolution, dimensions, or format.

    • 0 (default): Disables the feature.

    • 1 to 100: Enables the feature. For example, a value of 90 indicates that the image retains 90% of its original quality.

    Note

    This feature supports only the JPEG and WebP formats.

    Source Image Cache

    If a source image has multiple converted versions, enabling source image cache reduces the number of origin requests.

  6. Click OK to complete the setup.

Process images by using file URLs

  1. Select the supported image formats as described in Enable image editing.

  2. Add parameters to the request URL to perform custom transformations.

    • Format: http://example.com/image_01.png?image_process=action,param_value/action,param_value

      Field

      Description

      example.com

      Your accelerated domain name.

      image_01.png

      The name of the image.

      image_process

      A fixed parameter for image editing.

      action,param_value

      The action, parameter, and value for an image transformation. Separate multiple actions with forward slashes (/). Alibaba Cloud CDN applies transformations in the order they appear in the URL. For a list of supported parameters, see Image editing parameters.

    • Example: http://example.com/image_01.png?image_process=resize,w_200/rotate,90/format,webp. Result: The image is first proportionally resized to 200 px in width, then rotated 90°, and finally converted to the WebP format.

Image editing parameters

To perform a wider range of image transformations, add parameters to the request URL. The following table lists the supported parameters.

Feature

Parameter

Description

Format conversion

format

Converts the image to a different format.

Quality conversion

quality

Adjusts image quality.

Image crop

crop

Crops the image to a specified size.

Image resize

resize

Resizes an image to a specified size. Upsizing is not supported.

Image rotation

  • Automatic rotation: auto-orient

  • Specified rotation: rotate

Performs adaptive rotation on images with orientation parameters, or rotates an image clockwise by a specified angle.

Image color

  • Brightness: bright

  • Contrast: contrast

  • Sharpen: sharpen

Adjusts the image brightness, contrast, and sharpness.

Watermark

watermark

Adds an image or text watermark.

Image information

info

Retrieves image information, such as dimensions, format, and quality.

上一篇: Image editing overview 下一篇: Format conversion
阿里云首页 CDN 相关技术圈