After enabling image processing, customers can crop specific content from the original image and generate a new image by including cropping parameters in the request URL.
Note:
Image processing is a paid service. Currently, it is in a public beta phase and there are no charges. The timing for when fees will be introduced will be announced separately.
Centered Cropping: Crops an image of the specified width and height from the centered portion of the image. The starting point for width is (total image width - w) / 2, and the starting point for height is (total image height - h) / 2. The image content of width × height is then cropped from this origin point.
Specified X, Y Axis Cropping: Crops an image of the specified width and height based on the given x, y coordinates. The cropping starts from the point (x, y) and proceeds for the specified width and height.
Grid Cropping: Sets the origin position based on a 3x3 grid. The image is cropped horizontally by the indicated width (w) to the right and vertically by the indicated height (h) downward, starting from the set origin point.
Parameter Description and Examples
Parameter Name: cut.
Supported Parameter Value Descriptions:
Operation Instructions and Examples:
| Trimming Type | Descriptions | Examples |
|---|---|---|
| Centered trimming | The parameters are mid, w, h. It crops the specified width and height content from the center of the image. The starting point of width is (total width of image - w)/2, and the starting point of height is (total height of image - h)/2. After finding this origin point, it crops the image content with a size of width (w) × height (h). | http://www.example.com/a.png?action=cut:mid,w_400,h_200. Crops the specified width and height content from the center of the image. The starting point of width is (total width of image - w)/2, and the starting point of height is (total height of image - h)/2. Then, it crops the image content with a size of 400×200 starting from that origin point. |
| Specified X, Y Axis trimming | The parameters are x, y, w, h. It crops the specified width and height content based on the given x, y, width (w), and height (h). Taking x and y as the starting point, it crops the image content with a size of width (w) × height (h). Note: The x, y values must be filled in, or else the original image will be returned. | http://www.example.com/a.png?action=cut:x_10,y_10,w_400,h_200. Crops by the specified origin point of x=10, y=10, and crops the image content with a size of 400×200 starting from that point. |
| Grid trimming | The parameters are g, w, h. It sets the origin point based on a 3x3 grid layout. The horizontal crop direction is to the right with the indicated width (w), and the vertical crop direction is downward with the indicated height (h). It crops the image content with a specified width and height. | http://www.example.com/a.png?action=cut:g_NW,w_400,h_200. Grid Crop: Sets the origin point to the upper left corner of the 3x3 grid. It crops the image content with a width of 400 indicated by w to the right, and a height of 200 indicated by h downward, resulting in a cropped image content of 400×200. |