Positionable crop
Allows to crop an image with a non-centred 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. To set the coordinates of the crop rectangle, use the tl_px or/and br_px operations.
tl_px=X1,Y1
br_px=X2,Y2
To set the final size, you can use the width or/and height operations as described below.
Original image
Specify exact crop area
You can specify the top left and bottom right pixel of the crop rectangle. The image can be then resized to desired width.
/sample.li/kids.jpg?w=200&tl_px=900,0&br_px=1300,600
operation | description | example |
---|---|---|
tl_px | top left pixel coordinates | tl_px=900,0 |
br_px | bottom right pixel coordinates | br_px=1300,600 |
w | final image width | w=200 |
If you specify only top left or bottom right corner coordinates, the image is cropped and resized to the specified width or height, keeping proportions.
Combining positionable crop with resize modes
If you specify an exact crop rectangle, you can use all available resize modes - fit, bound or cover. For full details, see resize modes.
/sample.li/kids.jpg?w=490&h=170&tl_px=310,70&br_px=1550,580&func=fit&bg_color=3498db
operation | description | example |
---|---|---|
w | final width | w=490 |
h | final height | h=170 |
tl_px | top left corner coordinates | tl_px=310,70 |
br_px | bottom right corner coordinates | br_px=1550,580 |
func | resize mode | func=fit |
bg_color | background color | bg_color=3498db |