Common Cropping

Code editing and API calling are the only two methods supported.

You can start at any point on an image and crop the image into a rectangle with specified width and height. For details, see Table 1.

Parameter: crop

Table 1 Common cropping

Parameter

Value Description

Code Example

g

The location where cropping starts. g can be set to tl, top, tr, left, center, right, bl, bottom, and br. Figure 1 is a 3 x 3 grid illustrating these values. Each value locates at the top left corner of a grid.

image/crop,x_10,y_10,w_200,h_200,g_br

h

Height of the cropped image, ranging [0, original height].

w

Width of the cropped image, ranging [0, original width].

x

x-coordinate of the start point. The top left corner is the default origin. x ranges [0, original width of the image].

y

y-coordinate of the start point. The top left corner is the default origin. y ranges [0, original height of the image].

The origins of cropping are shown as Figure 1.

Figure 1 3 x 3 grid of cropping origins
  • If x is larger than the origin width, or y is larger than the origin height, the cropping cannot be executed and a fault will be returned.
  • If h is larger than the origin height and w is larger than the original width, the image will be cropped to the boundaries.

Example