Crop.photo Development
  1. Crop.photo API
Crop.photo Development
  • Crop.photo API
    • Introduction
    • Authentication
    • FAQs
    • Interactive API Testing
    • AI Lifestyle Crop
      POST
    • Auto Resize & Align
      POST
    • Body Aware Crop
      POST
    • Unrecognizable Crop
      POST
    • Remove Background
      POST
    • Create Banner Job
      POST
    • Banners Job Status
      POST
  1. Crop.photo API

AI Lifestyle Crop

Localhost
http://localhost:8081/v1
Localhost
http://localhost:8081/v1
POST
/crop/lifestyle
AI Lifestyle Crop in Crop.photo, is a dedicated feature aimed at optimizing lifestyle photos without altering their backgrounds. This API ensures ensures the object of focus - typically a product - is precisely aligned and sized using the advanced AI algorithms.
Example 1:
To resize the input image to a 1600x1200 dimension and with the below mentioned margins in pixels, use the API as follows:
Example 2:
To resize the input image to 3000x2000 with the specified margins, use the API as follows:

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json

Example
{
    "image_url": "https://loremflickr.com/640/480/nightlife",
    "minimum_margins": {
        "top": 2021,
        "bottom": 448,
        "left": 789,
        "right": 414,
        "unit": "px"
    },
    "output_format": "webp",
    "output_dimension": "81x5",
    "response_type": "stream",
    "ai_model": "SCENE_V1",
    "analysis_hints": [
        "sit"
    ]
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://localhost:8081/v1/crop/lifestyle' \
--header 'Content-Type: application/json' \
--data-raw '{
    "image_url": "https://loremflickr.com/640/480/nightlife",
    "minimum_margins": {
        "top": 2021,
        "bottom": 448,
        "left": 789,
        "right": 414,
        "unit": "px"
    },
    "output_format": "webp",
    "output_dimension": "81x5",
    "response_type": "stream",
    "ai_model": "SCENE_V1",
    "analysis_hints": [
        "sit"
    ]
}'

Responses

🟢200Binary Octel Stream Response
application/octet-stream
Body

🟢200Image Crop Response JSON
🟢200Success
🟠401Unauthorized
🟠400Invalid Input | Crop.photo
Modified at 2025-03-18 09:16:01
Previous
Interactive API Testing
Next
Auto Resize & Align
Built with