---
title: Change Image Background API
slug: change-image-background
url: https://apyverse.com/apyhub/service/change-image-background
provider: ApyHub
categories: [Image Processing]
auth: api_key
---

# Change Image Background API

Replace a foreground image background with a color or another image. Returns PNG downloads or signed URLs for product images and mockups.

## Endpoints

| Method | Path | Description | Atoms |
| --- | --- | --- | --- |
| POST | `processor/image/change-background/url` | What it does Fetches a foreground image from a URL, removes its background, and composites it onto… | 30 |
| POST | `processor/image/change-background/url/file` | What it does Fetches a foreground image from a URL, removes its background, and composites it onto… | 30 |
| POST | `processor/image/change-background/file` | What it does Uploads a subject image and either a background image or a background color, then retu… | 30 |
| POST | `processor/image/change-background/file/url` | What it does Changes an image’s background by sending a subject image plus optional background and… | 30 |

## About

## What it does
Change Image Background lets you replace the background behind a subject image and return a PNG with the new composition. Send either an image URL or a binary image, then choose a solid color background or a background image. You can also control subject size, rotation, opacity, placement, and background canvas size.

Use it when you need product shots on a clean color field, social cards with consistent branding, or quick mockups without editing in a design tool. The service removes the foreground background server-side, places the subject on the new background, and preserves the result as a PNG.

The URL endpoints accept `image_url` plus either `background_color` or `background_image_url`. The multipart endpoints accept `image` plus either `background_color` or `background_image`. Optional layout fields include `image_size`, `image_angle`, `image_opacity`, `image_position`, `background_size`, and `background_opacity`.

Depending on the endpoint, you get either a direct PNG download or a time-limited signed URL in `data`.

## Usage

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