Creating Image Styles

Context

By creating image styles, you can process the image such as cropping, compressing, and watermarking. If some common procedures are needed for multiple images, you can create image styles to avoid repetitive operations. Once a style is successfully created, it can be used by multiple images in the bucket.

When creating styles, you can view the style effects of the sample image on the right.

When using REST APIs to access Image Processing, you can call the style name in the URL to avoid inputting complicated commands. For details about the domain name rules for API access, see Style Access Method.

You can create a maximum of 100 styles for one bucket at one time.

Procedure

  1. On the homepage of the management console, choose All Services > Storage > Object Storage Service.
  2. Click the bucket name, and select Image Processing.
  3. Click Create Style to go to the style editing page. For details, see Figure 1.

    Figure 1 Creating a style

  4. On the editing page, you can edit the style name and basic properties. You can also set the resize mode, as well as perform operations like rotation/cropping, watermarking, and image output.

    • Style Name

      Input an easy-to-remember style name. Only letters (uppercase and lowercase), digits, periods (.), underlines (_), and hyphens (-) are allowed. The style name contains 1 to 256 characters. For example, rotate_0001.

    • Edit Mode

      You can either choose GUI mode for visible editing, or choose Code mode.

      An example code is as follows:

      image/sharpen,100/blur,r_1,s_1/resize,m_lfit,h_400,w_400,limit_1
    • Parameter settings

      You can set image effects, resizing, watermarks, and output parameter values.

      Ensure that this path and the sample image path are in the same region, or the preview will fail.

  5. After finishing editing the image style, click OK to save the style. The new style will be displayed in the style list.