Cloudimage - Documentation

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.

/v7/sample.li/kids.jpg?w=200&tl_px=900,0&br_px=1300,600

operationdescriptionexample
tl_pxtop left pixel coordinatestl_px=900,0
br_pxbottom right pixel coordinatesbr_px=1300,600
wfinal image widthw=200

Specify only one crop corner

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.

/v7/sample.li/kids.jpg?w=300&br_px=890,560

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.

/v7/sample.li/kids.jpg?w=490&h=170&tl_px=310,70&br_px=1550,580&func=fit&bg_color=3498db

operationdescriptionexample
wfinal widthw=490
hfinal heighth=170
tl_pxtop left corner coordinatestl_px=310,70
br_pxbottom right corner coordinatesbr_px=1550,580
funcresize modefunc=fit
bg_colorbackground colorbg_color=3498db