Skip to main content

Background

Background replacement and removal. Works on any image, generated or uploaded.

Both endpoints return a job_id with a matching GET …/status/{job_id} route, see Jobs.

Change background

POST /background/change/image/v1, replace the background of input_image, described by prompt. Commonly used mid-workflow, for example Generate → Background → Upscale to stage a product shot, then sharpen it.

curl https://api.imagepipeline.io/background/change/image/v1 \
-H "X-API-Key: $IMAGEPIPELINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input_image": "https://.../product.webp",
"prompt": "on a sunlit marble kitchen counter",
"output_format": "webp"
}'
FieldTypeDefaultNotes
input_imagestring,Required. Public URL of the image to restage.
promptstring,Required. Describe the new background, e.g. beach at sunset.
use_segmentationbooleantrueIsolate the subject via BiRefNet before compositing.
subject_descriptionstring,Short description of the subject to preserve.
tone_correctionnumber,Blends the edited background tones (0.0 to 1.0).
has_textboolean,Whether the image contains visible text or labels.
seedinteger-1-1 randomizes; set a value for reproducibility.
output_formatstringwebpwebp, jpeg, or png.
callback_urlstring,Receive a webhook on completion.

Remove background

POST /background/remove/image/v1, cut the subject out of input_image. Leave the background transparent, or pass recolor to drop the subject on a solid colour with an optional grounding shadow.

curl https://api.imagepipeline.io/background/remove/image/v1 \
-H "X-API-Key: $IMAGEPIPELINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input_image": "https://.../product.webp",
"recolor": "#F0F0F0",
"drop_shadow": true
}'
FieldTypeDefaultNotes
input_imagestring,Required. Public URL of the image to process.
recolorstring,Hex colour for the new background, e.g. #FFFFFF. Omit for transparent.
drop_shadowbooleanfalseAdd a soft drop shadow beneath the subject.
shadow_opacitynumber0.38Shadow darkness (0 to 1).
shadow_blurnumber0.018Blur radius as a fraction of image width.
shadow_dynumber0.022Vertical shadow offset as a fraction of height.
shadow_dxnumber0.004Horizontal shadow offset as a fraction of width.
output_formatstringwebpwebp, jpeg, or png.
callback_urlstring,Receive a webhook on completion.