Picsart Image AI icon

Picsart Image AI

Image processing with Picsart API: convert formats, crop, resize, remove backgrounds, enhance, upscale, restore faces, watermark, and analyze images

Image URL → Remove Background

AI-generated

Summary

Sends an image URL or binary data to the Picsart API to remove the background and replace it with a color or another image.

Inputs

  • image_url (required) — URL of the image to process. For Image URL resource, accepts a URL string or a mode (ID or URL) with validation.
  • backgroundType — Specifies the type of background to apply after removal: 'image' (for a background image) or 'color' (for a solid color). Default is 'color'.
  • backgroundImage — URL of the image to use as the new background. Only visible when 'Background Type' is set to 'image'.
  • backgroundColor — Color value (hex) to use as the new background. Only visible when 'Background Type' is set to 'color'.
  • format — Output image format: JPG, PNG, or WEBP. Default is PNG.

Output shape

A binary image (processed file) and a JSON object containing metadata about the source and the API result.

Returns binary data in the specified format. The JSON output includes the original image source identifier and the raw API result object.

Examples

Example 1: Remove background and replace with white

Set Background Type to 'color' and enter a white hex code.

Example 2: Remove background and place on a custom image

Set Background Type to 'image' and provide the URL of the background image.

Links

Discussion