API: Crop or expand
Crops or expands an image.
Request
POST /process/crop?x=100&y=100& width=800& height=600& resize=0.25& input=0a6677...
input | The input image ID. |
x, y, width, height | The crop rectangle. If the coordinates are outside of the image area, the image is expanded. |
background | The color, to use as background in areas where the image is transparent, or outside of the crop rectangle. Colors are written as rgb(R,G,B) or rgba(R,G,B,A) , where R, G, and B are values between 0 and 255, and A is a value between 0 (transparent) and 1 (opaque). |
resize | If provided, the cropped or expanded image is resized (scaled) by this factor. |
outputFormat | The desired output format. Valid formats are PNG and JPEG. |
outputQuality | The desired JPEG compression quality, an integer between 50 and 100. The default value is 95 (high quality). Values below 85 may lead to visible compression artefacts. |
Response
200 OK
{ "crop": [80, 140, 640, 320], "output": "a1b002..." }
crop | The applied crop rectangle (x, y, width, height). |
output | The produced image. |
outputFormat |
The format of the output image:
|