Editing

The Edit service applies basic image editing to an input image. The basic editing operations are resize, crop, flip, rotate and perspective manipulation.

post/edit

Request

  • Base URL
    https://api.picsart.io/tools/1.0
  • URL
    https://api.picsart.io/tools/1.0/edit
  • 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.)

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

Optionally select one of the image formats (JPG is chosen if left blank). Options are as follows:

  • JPG
  • PNG
  • WEBP
mode'resize' | 'crop' nullable

For crop mode, the outcome image will be center-cropped with the given size (width, height). For the resize mode, the smallest size will be fitted to preserve the original proportion of the image. When the outcome size is not provided with width and height, no cropping or resizing will be applied (see alternative options such as rotate, flip and perspective).

sizeinteger nullable

When defined, this parameter overrides and applies the value for both width and height.

widthinteger nullable

Width of outcome image. If the provided width is larger than the original width of the file, the original size of the image will be selected. When crop size is defined, but the x,y starting position is not provided, the crop will be a center-crop (i.e., equally cutting from each side).

heightinteger nullable

Height of outcome image. If the provided height is larger than the original width of the file, the original size of the image will be selected. When crop size is defined, but the x,y starting position is not provided, the crop will be a center-crop (i.e, equally cutting from each side).

crop_xinteger nullable

crop_x, toghether with crop_y, define the anchor point of the crop. This point will be the center of the crop area. The top-left corner corresponds to (0,0) point and the bottom-right corner corresponds to (widht,height) point.

crop_yinteger nullable

crop_y, toghether with crop_x, define the anchor point of the crop. This point will be the center of the crop area. The top-left corner corresponds to (0,0) point and the bottom-right corner corresponds to (widht,height) point.

crop_anchor'center' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' nullable

By default when crop_anchor or crop_x,crop_y pair are not provided, the crop will be done around the center of the image. This parameter is an easier option to crop_x,crop_y pair where the respective corner of the image will be cropped. Options for crop anchor are as follows:

  • center
  • top-left
  • top-right
  • bottom-left
  • bottom-right
flip'horizontal' | 'vertical'

Choose a way to flip the image.

rotatenumber float

Enter a float value to rotate the image from -180 to +180. Default is 0.

perspective_horizontalinteger

The horizontal perspective after edits.

perspective_verticalinteger

The vertical perspective after edits.

qualityinteger

This refers to the level of accuracy of the image processing. The greater the quality (i.e., the larger the number), the larger the image file size. The default value is 90, which is a good compromise between quality and file size.

Response

Success.

statusstring

Changes

    • breaking

      removed the media type application/json from the request body

    • breaking

      removed the success response with the status

    • 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

    • info

      api operation id video-edit removed and replaced with image-edit

    • info

      api tag Editing added

    • info

      api tag Edit removed

    • info

      added the media type multipart/form-data to the request body

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the success response with the status