Image Cropper API Documentation
Overview
The Image Cropper API offers a flexible way to crop images dynamically by analyzing their content and composition. Utilizing advanced image processing techniques, it identifies the focus area in images to produce optimally cropped versions suitable for various applications, including social media, content creation, and more.
Produces
Operations
POST /v1/crop
This endpoint allows users to upload an image under 5 MB for cropping, based on specified parameters.
Parameters
Type |
Name |
Required |
Description |
Schema |
Example |
Query |
technique |
Yes |
Specifies the cropping technique to be applied. |
string |
“edge” |
Query |
option |
Yes |
Specifies the cropping option to be applied. |
string |
“resolution” |
Query |
resolution |
Optional |
Crop sizes defined and passed by the user. Max 10. |
string of array |
“[(800,600),(1024,768)]” |
- Default:
technique
: “harris”
option
: “resolution”
resolution
: “[(800,600)]”
Response
- Format: Zipped file with images
Common Requests
Technique
Value |
Description |
contour |
The contouring technique detects the main subject in an image by identifying the largest contour. |
edge |
Uses the Canny edge detection algorithm to highlight edges in an image, identifying the focus area. |
harris |
Uses Harris corner detection to identify key features in an image for focus area determination. |
histogram |
Determines an image’s focus area by analyzing its grayscale histogram. |
rule_of_thirds |
Utilizes the Rule of Thirds, a classic photography composition method, to identify the focus area. |
Option
Value |
Description |
social |
Predefined social media crop sizes (Facebook, Instagram, Pinterest, Twitter, YouTube, LinkedIn). |
ratio |
Predefined crop size ratios. |
resolution |
Crop sizes defined and passed by the user. Max 10 resolution. |