tencent cloud

All product documents
Cloud Infinite
Basic Image Processing
Last updated: 2024-02-29 17:31:27
Basic Image Processing
Last updated: 2024-02-29 17:31:27

Overview

COS has integrated Cloud Infinite (CI), a one-stop professional multimedia solution that offers the image processing features outlined below. For more information, see Image Processing Overview.
Service
Feature
Description
Basic image processing
Proportional scaling, scaling image to target width and height
Regular cropping, cropping and scaling, cropping to circle, smart face cropping
Adaptive rotation, regular rotation
Format conversion, GIF format optimization, progressive display
Quality change for JPG and WebP images
Image blurring
Image sharpening
Watermarking
Image information acquisition
Including EXIF information
Quick image format conversion, scaling, and cropping for thumbnail generation


Basic Image Processing

When performing basic image processing, you need to specify the image processing rule. For more information, see Image Processing Overview. For all the code samples, visit GitHub. Below are some examples:

Scaling

String bucketName = "examplebucket-1250000000";
String key = "qrcode.png";
GetObjectRequest getObj = new GetObjectRequest(bucketName, key);
// Scale the width and height to 50% of the input image
String rule = "imageMogr2/thumbnail/!50p";
getObj.putCustomQueryParameter(rule, null);
cosClient.getObject(getObj, new File("qrcode-50p.png"));

Cropping

String bucketName = "examplebucket-1250000000";
String key = "qrcode.png";
GetObjectRequest getObj = new GetObjectRequest(bucketName, key);
// Crop the radius of an inscribed circle to an integer greater than zero and less than half of the shorter side of the input image. The center of the inscribed circle is the center of the image.
String rule = "imageMogr2/iradius/150";
getObj.putCustomQueryParameter(rule, null);
cosClient.getObject(getObj, new File("qrcode-cropping.png"));

Rotation

String bucketName = "examplebucket-1250000000";
String key = "qrcode.png";
GetObjectRequest getObj = new GetObjectRequest(bucketName, key);
// Rotate clockwise by 90 degrees
String rule = "imageMogr2/rotate/90";
getObj.putCustomQueryParameter(rule, null);
cosClient.getObject(getObj, new File("qrcode-rotate.png"));
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon