crop_px

crop_px allows to crop an image with a non-centered focal point. It is extremely useful when you want to crop a specific part of the image, like for example a face for a profile picture. The size parameter is composed of 2 parts: x1, y1, x2, y2 and -final_size.

The first part x1, y1, x2, y2 are the top-left and bottom-right coordinates of crop rectangle. For example (0, 0, 500, 500) will crop the top-left 500 x 500px square.
The second part -final_size specifies the size (width x height) of the resulting cropped image. Basically, after cropping the image according to (0, 0, 500, 500), Cloudimage will resize it to final_size px width and keep proportions. If you fit the cropped image into a box of width x height, similar to the cover operation, you can use width x height, for example: -200x300.

Origin image

alt text


Non-centered crops