---
title: Change Background of Images API
slug: change-image-background
url: https://apyhub.com/apyhub/service/change-image-background
provider: ApyHub
categories: [File Manipulation]
auth: api_key
---

# Change Background of Images API

Compose a subject image onto a new background using files or URLs. Returns PNG downloads or signed links for product shots and social assets.

## Endpoints

| Method | Path | Description | Atoms |
| --- | --- | --- | --- |
| POST | `/processor/image/change-background/file` | What it does Uploads a subject image and a background image, then returns the generated result as a… | 2000 |
| POST | `/processor/image/change-background/file/url` | What it does Uploads a subject image and optional background settings as multipart form data, then… | 2000 |
| POST | `/processor/image/change-background/url/file` | What it does Fetches a foreground image from a URL, removes its background, and composites it onto… | 2000 |
| POST | `/processor/image/change-background/url` | What it does Fetches a foreground image from imageurl, removes its background, and composites it on… | 2000 |

## About

## What it does
Change Image Background lets you place a subject image onto a new background and get back a PNG. Send either a multipart upload or image URLs, then choose a solid background color or a background image, along with optional sizing, rotation, opacity, and placement settings.

Use the multipart endpoints when you already have the files in hand, or the URL endpoints when your images live elsewhere. The request schemas support a foreground image plus either `background_color` or a background image input. You can also adjust `image_size`, `image_angle`, `image_opacity`, `image_position`, `background_size`, and `background_opacity` to control the final composition.

The service removes the subject background server-side before compositing, which makes it useful for product shots, profile images, marketplace listings, and social assets. If you want a direct file response, use the download endpoints, which return the generated PNG as binary data.

If you prefer a hosted result, use the signed-link endpoints. Those return a `data` field containing a time-limited pre-signed URL to the generated PNG, suitable for storage or immediate download.

## Usage

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/apyhub/service/change-image-background
