Techniques

AI Background Removal and Replacement Guide

How AI background removal works, where it fails, how to prep a photo and how to swap the background with an edit model so light and shadows fit the new scene.

7 min read6 promptsChecked November 12, 2026

Illustration for the guide on removing and replacing a background to put a subject into a new scene
Solistra image
Contents

Background work comes in two kinds. Background removal cuts out the subject and leaves transparency around it, so you can drop the cutout onto a cover, a slide or another image. Background replacement puts the subject straight into a new scene, and here the light, shadows and perspective have to match, or the person will look pasted in.

Below we'll look at how both approaches work, where they go wrong and how to write an instruction for replacing a background.

How background removal works

Dedicated models don't draw anything new. For every pixel, they decide whether it belongs to the subject or the background. The BRIA RMBG 2.0 model card describes the output as an alpha matte: a single-channel image where each pixel value is its degree of opacity. That's why a hair edge can come out semi-transparent instead of jagged.

These models are trained on thousands of hand-labeled photos: people, objects, animals, images with text. That explains their strengths and weaknesses.

What works well:

  • a portrait or a full-length person against a contrasting background
  • a studio shot on a plain backdrop
  • a clean silhouette without small protruding details

What's hardest:

  • fluffy and fine hair, fur, feathers
  • glass, veils, smoke and other semi-transparent materials
  • a subject the same color as the background, such as a black coat against a dark wall
  • several people touching each other

The Flux Background Remove LoRA model card names the same limits directly: the model works best when subject and background are clearly separated, hair and fur may show edge artifacts, and semi-transparent objects aren't separated perfectly.

Portrait on a plain gray background that is easy to cut out
Portrait on a plain teal background with a clear silhouette for background removal
Portraits on plain gray and teal backgrounds that are easy to cut outSolistra image

How to prepare the photo

  • Contrast with the background. The more the subject differs from the background in color and brightness, the cleaner the edge.
  • A sharp edge. A blurry silhouette gives a blurry mask. Heavy bokeh in the background helps, but a blurry subject gets in the way.
  • A complete silhouette. Hands or the top of the head cut off by the frame will stay cut off after removal.
  • No extra people nearby. The model may decide the person next to your subject is also the main subject.
  • The right file format. Ideogram reminds you to download the result as PNG or WebP to keep the transparency. JPEG has no transparency, so the background turns solid.

If you don't need to cut out the subject but want to remove one stray object and fill in the space behind it, that's a different task. This is exactly why Ideogram treats background removal and object removal separately: in the second case, the scene has to be painted in.

Replacing the background with an edit model

There are two ways to put a subject into a new scene.

  1. Cut out and composite. Remove the background, then place the cutout on a new image in Photo Studio («Фотостудия»). This gives the most precise edge, but you'll have to match the light and shadows by hand.
  2. Edit by instruction. Attach the photo to an edit model and describe the new background in words. The model matches the light itself, but it may change the subject slightly.

Recraft's API splits background replacement into two modes: in one, the model finds the background itself and redraws it from a description, and in the other, you mark the area to change with a mask. In Solistra you get a similar result with an instruction: say what changes and list what has to stay.

The FLUX guide gives the key advice for edits like this: describe not just the new location but also its light, so the subject fits into the scene. A good instruction has three parts:

  1. What to replace. "Replace the gray background with..."
  2. What the new scene and its light are like. The place, the time of day, where the light comes from and what it's like.
  3. What to keep. Face, pose, clothing, hairstyle, framing.

For edits like this, the Gemini documentation suggests the template "change only this element, keep everything else exactly the same, preserving the style, lighting and composition". The word "only" and the list of things that stay put work as a mask made of words.

Prompt examples

PromptFrom the studio to a park

Replace the gray studio background with an autumn park full of yellow maples, blurred into soft bokeh. Warm light from a low evening sun on the left, matching the light on the subject's face. Keep the face, hairstyle, clothing, pose and framing unchanged.

PromptA plain background for an avatar

Replace the background with a flat solid dark blue, with no gradient or texture. Don't change the person: facial features, hair, clothing and pose stay as in the original. No traces of the old background should remain along the hair edge.

PromptA night city behind her

Place the woman on a big city street at night after rain: wet asphalt, pink and blue neon signs, blurred car lights. Add colored neon reflections to her face and hair on the side where the signs are. Keep her face, clothing and pose.

PromptThe view from a window in an interior

In this room, replace the view outside the window: instead of the neighboring building, a winter forest and snowy hills under an overcast sky. Keep the furniture, walls, room lighting and the objects on the windowsill unchanged.

PromptA background for a business portrait

Replace the background with a bright modern office with large windows and plants, heavily blurred, shallow depth of field. Soft daylight from the front and side. Keep the person completely intact: face, glasses, jacket and hand position.

PromptShadows when replacing the background

Place the man in the black coat against a light concrete wall at sunny midday. Add a crisp shadow from him on the wall falling to the right, with hard light from the left. Don't change the coat, face, pose or framing.

Common mistakes

  • A new scene with no light. "Replace the background with a beach" without a word about the sun gives you a subject in studio light against a bright day. Describe the direction and color of the light.
  • Not saying what to keep. An edit model may change the clothing or the facial expression along the way. List what stays the same explicitly.
  • Saving as JPEG. The transparent background disappears. You need PNG or WebP.
  • A tricky edge left unchecked. Zoom in on hair, fur and glass, since that's where traces of the old background most often remain.
  • A different perspective. If the subject was shot from below and the new background from above, the composite is obvious at a glance. Give the background's angle, for example "camera at eye level".
  • Someone else's photo. You can only move a person into a new scene with their consent.

How to try it in Solistra

In the Image («Фото») section, a finished result in the feed has an Enhance («Улучшить») menu. If the tool is available for that result, the menu includes Remove background («Удалить фон»). The result appears in the feed as a separate item, and the original stays. This is a separate operation, and it uses credits.

To replace a background, open Flux Kontext Max or Kling O1, attach the photo with the «+» button or choose As reference («Как референс») in the result's menu, and paste your instruction. The cost shows on the run button before you press it. There's more on lighting a new scene in the guide on light and camera.

Sources and licenses

Text
Solistra text. Our own wording and prompt examples, quotes under 15 words
Images

Other images — Solistra image

Checked
November 12, 2026

Русская версия

Telegram