Editing

Use AI to define the segment that should be cropped, e.g. foreground or product name (e.g. hat, gloves, boots, etc).

post/smart-crop

Request

  • Base URL
    https://api.picsart.io/tools/1.0
  • URL
    https://api.picsart.io/tools/1.0/smart-crop
  • Auth
    API key in header X-Picsart-API-Key

Request body multipart/form-data

imagestring binary

Source image file (binary). (If this parameter is present, the other image source parameters must be empty.)

image_urlstring uri

Source image URL. (If this parameter is present, the other image source parameters must be empty.)

image_idstring

Deprecated. Source image ID of an image previously uploaded to Picsart or result image ID from a different API. (If this parameter is present, the other image source parameters must be empty.)

segmentstring required

The segment to crop. Use either 'foreground', or define the name of the segments such as 'hat' or 'boots'. Recommendation: use short and clear names of the segment (e.g. object or area). We don't recommend using long prompts.

ratio'1:1' | '4:3' | '3:2' | '16:9' | '21:9' | '4:5' | '9:16' | '2:3' | '5:4'

Optionally enforce the ration of the result image. When both width and height parameters are provided, they should match this ratio. In case either width or height are provided, the other value will be calculated based on this ratio.

widthinteger

Specify the width of the output image in pixels.

heightinteger

Specify the height of the output image in pixels. The default is 1024 and the maximum acceptable value is 8000.

format'JPG' | 'PNG' | 'WEBP'

Optionally select one of the image formats. Options are as follows:

  • JPG
  • PNG
  • WEBP

Response

Success.

statusstring

Changes

    • warning

      the optional response header X-Correlation-Id removed for the status 400

    • warning

      the optional response header X-Correlation-Id removed for the status 401

    • warning

      the optional response header X-Correlation-Id removed for the status 403

    • warning

      the optional response header X-Correlation-Id removed for the status 404

    • warning

      the optional response header X-Correlation-Id removed for the status 405

    • warning

      the optional response header X-Correlation-Id removed for the status 413

    • warning

      the optional response header X-Correlation-Id removed for the status 415

    • warning

      the optional response header X-Correlation-Id removed for the status 429

    • warning

      the optional response header X-Correlation-Id removed for the status 431

    • warning

      the optional response header X-Correlation-Id removed for the status 500

    • warning

      the optional response header X-Correlation-Id removed for the status 503

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • info

      added the new optional request property ////

    • info

      request property //// list-of-types was widened by adding types array to media type multipart/form-data

    • info

      added the non-success response with the status