请选择
Edge Acceleration
  • Site Acceleration
    • Overview
    • Access Control
      • Token Authentication
    • File Optimization
      • Smart Compression
    • Network Optimization
      • HTTP/2
      • HTTP/3(QUIC)
        • Overview
        • Enable HTTP/3
        • QUIC SDK
          • SDK Overview
          • SDK Download and Integration
          • Sample Code
            • Android
            • iOS
          • API Documentation
            • Android
            • iOS
      • IPv6 Access
      • Maximum Upload Size
      • WebSocket
      • Client IP Geolocation Header
      • Client IP Geographical Location
      • gRPC
    • URL Rewrite
      • Access URL Redirection
      • Origin-Pull URL Rewrite
    • Modifying Header
      • Modifying HTTP Response Headers
      • Modifying HTTP Request Headers
    • Custom Error Page
    • Request and Response Actions
      • Processing order
      • Default HTTP Headers of Origin-Pull Requests
      • Default HTTP Response Headers
  • Smart Acceleration
  • L4 Proxy
    • Overview
    • Creating an L4 Proxy Instance
    • Modifying an L4 Proxy Instance
    • Disabling or Deleting an L4 Proxy Instance
    • Batch Configuring Forwarding Rules
    • Obtaining Real Client IPs
      • Obtaining Real TCP Client IPs via TOA
      • Obtaining Real Client IPs Through Protocol V1/V2
        • Overview
        • Method 1: Obtaining Real Client IPs Through Nginx
        • Method 2: Parsing Real Client IPs on Application Server
        • Format of Real Client IPs Obtained Through Proxy Protocol V1/V2
      • Transmitting Client Real IP via SPP Protocol
  • Edge DNS
    • Hosting DNS Records
      • Modifying DNS Servers
      • Configuring DNS Records
      • Advanced DNS Configuration
    • Domain Connection
      • Adding A Domain Name for Acceleration
      • Ownership Verification
      • Modifying CNAME Records
    • Domain alias
      • Overview
      • Configuration Guide
      • Batch Connecting SaaS Domain Names
      • Configuring Alias Domain Names for Disaster Recovery
    • Traffic Scheduling
      • Traffic Scheduling Management
    • Origin Configuration
      • Load Balancing
        • Overview
        • Quickly Create Load Balancers
        • Health Check Policies
        • Viewing the Health Status of Origin Server
        • Related References
          • Load Balancing-Related Concepts
          • Introduction to Request Retry Strategy
      • Origin Group Configuration
      • Origin-pull configuration
        • Configuring Origin-Pull HTTPS
        • Host Header Rewrite
        • Controlling Origin-pull Requests
        • Redirect Following During Origin-Pull
        • HTTP/2 Origin-Pull
        • Range GETs
      • Related References
        • ld Version Origin Group Compatible Related Issues
        • VOD Origin Server Details
      • Collect EdgeOne origin-pull node IP
  • Edge Cache
    • Overview
    • EdgeOne Cache Rules
      • Content Cache Rules
      • Cache Key Introduction
      • Vary Feature
    • Cache Configuration
      • Custom Cache Key
      • Node Cache TTL
      • Status Code Cache TTL
      • Browser Cache TTL
      • Offline Caching
      • Cache Prefresh
    • Clear and Preheat Cach
      • Cache Purge
      • URL Pre-Warming
    • How to improve the Cache Hit Rate of EdgeOne
  • Rules Engine
    • Overview
    • Supported Matching Types and Actions
    • Rule Management
    • variables
  • Image Processing

Image Processing

Image Processing

Image processing is to resize and convert images. The process of processing, caching and responding is taken place on EdgeOne servers. Your own origin only needs to store the original images, thus reducing image management costs on your side. EdgeOne can also compress images to improve page load speed without sacrificing visual impact.

Supported Image Processing Capability

Resize

Capability
Parameter Name
Parameter Value(type/pixel)
Description
Resize
eo-img.resize
w/<Width>,for example:w/100
Specify width, height adaptive
h/<Height>,for example:h/100
Specify height, width adaptive
w/<Width>/h/<Height>,for example:w/100/h/100
Specify width and height
l/<Long>,for example:l/100
Specify long side, short side adaptive
s/<Short>,for example:s/100
Specify short side, long side adaptive

Format Conversion

Support converting the original image to the specified format by carrying the specified parameter
Capability
Parameter Name
Supported Input Formats
Supported Output Formats
Format Conversion
eo-img.format
Static image:jpg、png、bmp、jp2、jxr、gif、webp、avif、heif
All static:jpg、png、bmp、jp2、jxr、gif、heif、webp、avif
Dynamic image:gif、webp、avif、heif
Static:jpg、png、bmp、jp2、jxr(take the first frame of gif animation as a single static image) Dynamic:gif、webp、avif、heif

Limitations

The original image size for processing should not exceed 32MB.
The width and height of the input original image should not exceed 30,000 pixels, and the total pixels should not exceed 250 million pixels; for dynamic images, the width x height x frame count of the original image should not exceed 250 million pixels.
The input gif format animation frame count should not exceed 300 frames.
The width and height settings of the output image should not exceed 9999 pixels.
Note
Any of the following situations may cause the image processing to fail and return the original image:
1. If any parameter of the original image and the result image for image processing exceeds the above limits, we will not be able to process the image and can only respond with the original image.
2. If incorrect request parameters are entered, the image will not be processed and will be returned directly as the original image, such as the following situations:
Duplicate input parameters: eo-img.resize=w/100&eo-img.resize=w/200, which will be considered as illegal parameter passing;
pelling error: any format error or spelling error parameter, such as eo-img.resize=w=100, will be considered as illegal parameter passing;
Resize parameter error: the parameters w/ (width) and h/ (height) should not be mixed with s/ (short side) and l/ (long side). For example, w/300/s/200 is illegal parameter passing, and the image will remain unchanged.
3. If the image scaling function is turned off within the console, all eo-img related parameters will be treated as normal query strings and will not trigger the image processing function.
4. If other exceptions occur that prevent normal image processing, we will prioritize providing the original image, and in subsequent requests, we will automatically try to reprocess the image.

Pricing

This feature is billed based on the number of image resizing requests. For more information, see VAU Fee (Pay-as-You-Go).
Note
This feature is in the free trial period now.

Directions

You can add image processing parameters to the client request URL to resize images.
If you don’t want to change the original client request URL, please try edge functions. See Converting Images with Edge Functions.

Adding Image Processing Parameters to the Client Request URL

You can add image processing parameters to the client request URL to resize images.
1. Log in to the EdgeOne console. click on the site list in the left menu bar, click on the site to be configured in the site list, and enter the site details page.
2. On the site details page, click Site Acceleration > Media Processing on the left sidebar.
3. On the page that appears, toggle Image Resize on.

4. After enabled, you only need to pass the image scaling demand by concatenating the eo-img related parameter to the Request URL in the Client requests. EdgeOne will automatically complete the image processing based on the image processing parameter in the Request URL. For example: https://www.example.com/foo.png?eo-img.resize=w/100

Image Processing Example

In the following examples, the original image is 500 × 280 pixels in resolution and 500 KB in size.
1. Resize the image width to 200 pixels and scale the height automatically:
Request URL: http://www.example.com/foo.png?eo-img.resize=w/200

2. Resize the image height to 200 pixels and scale the width automatically:
Request URL: http://www.example.com/foo.png?eo-img.resize=h/200

3. To resize the image width to 300 pixels and the height to 200 pixels:
Request URL: http://www.example.com/foo.png?eo-img.resize=w/300/h/200
Important
If both the width and height are specified, the aspect ratio of the original image may not be retained.

4. Resize the long side to 400 pixels and scale the short side automatically:
Request URL: http://www.example.com/foo.png?eo-img.resize=l/400

5. Resize the short side to 200 pixels and scale the long side automatically:
Request URL: http://www.example.com/foo.png?eo-img.resize=s/200

6. Convert the image format to WebP:
Request URL: http://www.example.com/foo.png?eo-img.format=webp
Output image format: WebP
7. Resize the width to 200 pixels, scale the height automatically, and convert the format to WebP.
Request URL: http://www.example.com/foo.png?eo-img.resize=w/200&eo-img.format=webp