Last updated:2021-08-20 12:00:22
Image processing is the feature of generating thumbnails and adding watermarks, which is provided by Kingsoft Cloud based on the basic features of data storage. You can create a maximum of 100 image styles for a bucket. For the convenience of developers, Kingsoft Cloud provides predefined image styles, which can greatly shorten the length of the request URL and provide better readability.
Log in to the KS3 console. In the left navigation pane, click Bucket. On the page that appears, click the name of the bucket where you want to create thumbnails. On the page that appears, click the Picture Processing tab and then click Create Style.
On the Basic Editing tab, specify the name of the style, the width and height of the thumbnail, rotation mode, image format, image quality, and whether to enable centered cropping. When you set the image style, you can view the width and height of the source image on the left side of the Rendering Preview section and preview the thumbnail on the right side. The width and height of the thumbnail are displayed under the thumbnail.
Note:
(1) Style Name: The name will be used to reference this style in subsequent operations.
(2) Enable Suffix Matching: If the suffix of the name of an image matches the content you specified, the style is applied to this image. For example, if you specify example as the style name and /png as the suffix, all images whose name suffix with png are processed by using the style named example.
(3) Rules of resizing images:
(4) Rotation Mode: You can set this parameter to No Rotation, Rotate automatically according to exif, and Rotate according to the custom angle.
(5) Picture Format: You can use the source image format or select one of the following formats as the final format of the thumbnail: JPG, JPEG, PNG, GIF, WBMP, and BMP.
Note: If you have enabled the source image protection feature, the thumbnail protection feature does not work. To enable the thumbnail protection feature, disable source image protection first.
(6) Picture Quality: You can set this parameter to reduce the size and adjust the quality of the final image. Adjusting the image quality may affect the image effect. Therefore, properly adjust the quality based on your requirements.
(7) Add Watermark: You can specify whether to add a watermark, and whether to add a text watermark or an image watermark.
You can add a text watermark or an image watermark to an image. You can perform the following operations when you add a watermark:
Specify the watermark text. The text that you specify does not wrap. If the text contains too many characters and exceeds the edge of the image, only a part of the text is displayed. Therefore, pay attention to the effect when you specify the text.
Set the opacity of the watermark.
Set the font, size, and color of the text. The unit of the font size is twip. 1 twip equals 96 DPI, 1440 TPI, or 0.0666667 pixel.
Set the position of the watermark. You can further adjust the watermark position by setting the X-axis Margin(px) and Y-axis Margin(px) parameters. The X-axis Margin(px) parameter indicates the horizontal distance between the right edges of the watermark and the image. The Y-axis Margin(px) parameter indicates the vertical distance between the bottom edges of the watermark and the image. The following figure shows how to set the position.
Thumbnail + watermark:
You can downsize an image and add a watermark to the thumbnail in sequence.
Did you find the above information helpful?
Please give us your feedback.
Thank you for your feedback.