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
|
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.
- 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
- Set the start point of cropping to (1000, 500), and set the width and height of cropping to 1000 both.

- The cropping starts from (10, 10) in the bottom right (br) grid. The width and height are both set to 200.

Last Article: Cropping Images
Next Article: Inscribed Circle

Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.