TL;DR: Background replacement prompting means writing the instruction for swapping what's behind a subject, and the exact wording changes with the tool. A drawn mask only needs a description of the fill. A reference-image workflow needs an explicit "keep the subject, use this as the backdrop" instruction. A text-only edit needs you to state what stays unchanged, because there's no mask to do that for you.
What is background replacement prompting, and which tool do you actually need?
Four tool classes handle this, and they work on different mechanics, not just different interfaces.
Masked inpainting in an editor. You draw or paint a selection over the area to change, and the prompt only has to describe what fills that area. The rest of the pixel grid is untouched by construction, not by the model's good behavior.
Reference-image workflows. You hand the model a second image and tell it, in words, which image is the subject and which supplies the new setting. There's no pixel mask, so the model is inferring your intent from the prompt alone.
Text-only regeneration. No mask, no reference image, just a sentence. You name the element to change and instruct the model to leave everything else alone, in words, because there's nothing else doing that job.
Dedicated background-removal features. No prompt field at all. A one-click cutout that guarantees perfect subject preservation because it doesn't generate anything, then you composite a real photo or a separately generated backdrop behind it.
| Feature | Masked inpaint | Reference image | Text-only edit | Dedicated removal |
|---|---|---|---|---|
| What you provide | A drawn or painted mask | A second reference image | Only the text prompt | Only the source image |
| What the prompt describes | Just the fill content | What to keep vs. what to borrow | What changes and what stays | Nothing, there's no prompt field |
| Subject-preservation guarantee | Pixel-level, outside the mask | Model-dependent | Model-dependent | Absolute, it's a cutout |
| Documented examples | OpenAI GPT Image edits, Ideogram Magic Fill, Midjourney Editor | Gemini 3 Pro Image, GPT Image references | Gemini's semantic-masking template | Canva Background Remover |
How do you write a prompt for masked inpainting in an editor?
Because the mask already protects the subject, the prompt's only job is describing what goes in the hole, and vendors are explicit that they still need real words to fill it well.
OpenAI's own documentation puts it plainly for GPT Image: "Masking with GPT Image is entirely prompt-based. The model uses the mask as guidance, but may not follow its exact shape with complete precision" (developers.openai.com/api/docs/guides/image-generation, accessed August 27, 2026). The mask itself has a hard requirement: "The mask image must also contain an alpha channel," and the image and mask "must be of the same format and size."
Ideogram's Magic Fill works the same way, mask plus prompt, but adds a craft detail most people skip: "Adjust the generation window to include both masked areas and some surrounding image content for context" (docs.ideogram.ai/canvas-and-editing/canvas/magic-fill, accessed August 27, 2026). A generation window drawn too tight around the mask starves the model of context for matching light and texture.
Midjourney's own Editor calls the same mechanic Vary Region (or "Erase" on the web), and its tips page is unusually direct about selection size: "Larger selections give Midjourney more context, which can help ensure the new content matches the rest of your image. However, be careful, selecting too much might lead to new elements blending or replacing parts of the original image you wanted to keep" (docs.midjourney.com's Help Center, article updated July 27, 2026; read via its public Help Center JSON API since the domain blocks direct browser fetches, accessed August 27, 2026).
1 — PRODUCT ON MARBLE, MASKED FILL
[Fill area: everything behind the ceramic mug, mask already drawn]
Warm honey-oak kitchen counter, soft midday window light from camera-left,
shallow depth of field, background slightly out of focus. Match the mug's
existing highlight direction on its left rim.
2 — PORTRAIT, OFFICE BACKGROUND
[Fill area: everything behind the subject's shoulders and head, mask
drawn tight to the hairline with a 6px feather]
Blurred modern office interior, glass partitions, a monitor and a plant
out of focus, cool 5600K daylight matching the subject's existing catchlights.
Generation window expanded to include both shoulders for lighting context.
3 — REAL ESTATE, SKY REPLACEMENT
[Fill area: sky above the roofline, selection includes 10% of the roofline
itself for blend context]
Clear golden-hour sky, sun low and camera-left, warm 3200K rim light on
any exposed edges, thin high clouds, no visible sun disc. Horizon stays
exactly where the original roofline meets the mask.
4 — FASHION EDITORIAL, STREET BACKDROP (Midjourney Vary Region style)
Wet cobblestone street at dusk, neon signage reflections, camera height
at model's eye level, cool blue ambient with warm practical lights.
Short, direct wording only, per Midjourney's own guidance for Vary Region.
How do you write a prompt for a reference-image background swap?
Here there's no mask at all, so the prompt has to do the job a mask would otherwise do: tell the model which image is the subject and which is only there for its setting.
OpenAI's Images API documents this as a distinct capability from masking: "You can use one or more images as a reference to generate a new image" (developers.openai.com/api/docs/guides/image-generation, accessed August 27, 2026). Google's Gemini 3 image models go further on scale. Per Google's own docs, you can "mix up to 14 reference images," split by role: Gemini 3 Pro Image (Nano Banana Pro) accepts "up to 6 images of objects with high-fidelity," "up to 5 images of characters to maintain character consistency," and "up to 3 images to be used as style references" (ai.google.dev/gemini-api/docs/image-generation, accessed August 27, 2026). Those are three separate slots for three separate jobs, and naming which slot each image fills is exactly what your prompt needs to do explicitly, since the model has no other way to know.
5 — MODEL INTO A REFERENCE LOCATION
[Image 1: the subject, a model in a tailored coat] [Image 2: a reference
photo of a specific alley, wet asphalt, string lights overhead]
Keep the subject in image 1 completely unchanged, pose and outfit and
face untouched. Place her standing in the location shown in image 2,
matching that scene's string-light color temperature on her face and coat.
6 — PRODUCT INTO A REFERENCE SHELF DISPLAY
[Image 1: the subject, a boxed product on a white sweep]
[Image 2: a reference photo of a specific retail shelf, warm store lighting]
Do not alter the product or its box in image 1 in any way. Composite it
onto the middle shelf shown in image 2, casting a soft contact shadow
consistent with that shelf's overhead lighting.
7 — HEADSHOT AGAINST AN OWNED OFFICE PHOTO
[Image 1: the subject's headshot] [Image 2: a reference photo of the
company's actual lobby, taken on a phone, slightly wide angle]
Keep the face, hair and clothing in image 1 exactly as photographed.
Use image 2 only for the background and its ambient color temperature,
softened and out of focus behind the subject.
Nano Banana Pro's reference-image handling has enough of its own texture to deserve its own page, including how the object, character and style reference slots interact.
How do you write a text-only background-replacement prompt with no mask and no reference?
This is the hardest mode to get right, because nothing but your wording is protecting the subject. Google's Gemini documentation calls its version "semantic masking" and publishes the exact template: "Using the provided image, change only the [specific element] to [new element/description]. Keep everything else in the image exactly the same, preserving the original style, lighting, and composition" (ai.google.dev/gemini-api/docs/image-generation, accessed August 27, 2026). Google's own worked example applies it to a whole element (swapping a sofa), not specifically a background, but the same template is what a single-image, no-mask background swap needs: name the region, then explicitly say what must not change.
8 — PORTRAIT, INDOOR TO OUTDOOR
Using the provided image, change only the background behind the person
to a sunlit park path with soft green bokeh. Keep everything else in the
image exactly the same, including the person's pose, clothing, face,
and the existing light direction on their skin.
9 — PET PHOTO, CARPET TO PARK
Using the provided image, change only the floor and background behind
the dog to a grassy park on an overcast day, even soft light, no harsh
shadows. Keep the dog itself, its pose and its fur detail exactly
unchanged.
10 — FOOD PHOTOGRAPHY, MARBLE TO RECLAIMED WOOD
Using the provided image, change only the surface and background behind
the plate to a rustic reclaimed-wood table with warm 3000K side light.
Keep the plate, food styling and existing highlights on the food
exactly the same.
When should you use a dedicated background-removal feature instead of any of these?
When you need a guaranteed-clean cutout and the "new background" step can happen separately. Canva's own help page draws the line explicitly: "Background Remover uses AI technology to detect and remove backgrounds automatically. It's considered an everyday editing tool, and not a content generator" (canva.com/help/background-remover, accessed August 27, 2026). There's no prompt field involved: you select the image, click the tool, and refine the cutout with erase and restore brushes. Canva also documents real limits worth knowing before you rely on it for production work: it currently handles photos "under 9MB in size," isn't available for vector images, and any upload "with a resolution of more than 10MP will also be downscaled to 10MP after removing its background."
The workflow that follows a clean cutout is two prompts, not one: a backdrop-only prompt with no subject in it at all, then compositing your cutout on top.
11 — MARKETPLACE-COMPLIANT WHITE SWEEP (backdrop only, no subject)
Pure seamless white studio backdrop, subtle soft gradient toward the
edges, even diffuse lighting from directly overhead, no visible seams
or props. Leave the lower-center third empty for product placement.
12 — LIFESTYLE BACKDROP FOR COMPOSITING (backdrop only, no subject)
Sunlit kitchen counter scene, honey-oak surface, blurred greenery through
a window behind, warm 3200K light from camera-left. No products, no
people, framed so a product can be composited onto the counter's center.
13 — CONSISTENT STUDIO BACKDROP FOR A TEAM PAGE (backdrop only, batch use)
Neutral warm-gray gradient backdrop, soft top-left key light, no visible
floor line, cropped for a head-and-shoulders composite. Repeat identically
for every headshot in the set so lighting direction never varies between
employees.
How do you match lighting direction and color temperature between subject and background?
This is craft, not a vendor parameter, so treat it as a checklist rather than a documented feature. Look at the subject's existing catchlights and cast shadow first: they tell you where the original light source sat. Then write the new background's light from the same direction and, if the subject was shot under warm tungsten or cool daylight, say so in Kelvin or in plain words like "warm 3200K" or "cool overcast daylight," because vague words like "nice lighting" give the model nothing to match against.
14 — MATCHING A WARM INDOOR KEY LIGHT
Background: dim wine bar interior, warm 2800K tungsten pendant lights,
key light falling from upper-left to match the existing warm highlight
on the subject's left cheek. No cool or blue light sources anywhere
in the new background.
15 — MATCHING OVERCAST, DIRECTIONLESS LIGHT
Background: foggy coastal cliffside, flat overcast sky, no directional
shadows, cool 6500K neutral light matching the subject's existing
shadowless, evenly lit skin tone. Avoid any sunbeam or hard shadow.
How do you get clean edges on hair and transparent or semi-transparent subjects?
Fine edges are where masked tools show their seams fastest. Ideogram's own generation-window advice applies directly here: giving the model "surrounding image content for context" around a hairline, rather than masking tight to every stray strand, gives it room to render soft transitional pixels instead of a hard cutout line. Ask explicitly for the transition, not just the fill.
16 — FLYAWAY HAIR AGAINST A NEW BACKGROUND
[Fill area: background only, mask feathered 8px past the hairline,
generation window expanded to include the full head and shoulders]
Soft blue-gray studio backdrop. Preserve individual flyaway hair strands
as semi-transparent over the new background rather than a hard silhouette
edge. No visible mask line at the hairline.
17 — SHEER FABRIC OVER A NEW BACKDROP
[Fill area: background behind a subject wearing a sheer sleeve]
Soft cream backdrop, even diffuse light. Where the sleeve fabric is
semi-transparent, let the new backdrop's color show through faintly,
matching real fabric transparency rather than treating the sleeve edge
as a hard cutout.
How do you keep the subject completely unchanged while everything behind it changes?
This is the promise every one of these tools makes and the one that breaks most often on a full-frame regeneration. A drawn mask enforces it structurally, which is why OpenAI's spec matters here too: masking is "entirely prompt-based" but still confined to the masked pixels. Without a mask, your only lever is explicit, repeated instruction, which is exactly what Google's own template does by pairing "change only the [element]" with "keep everything else exactly the same." Say both halves every time; the negative half is not optional.
18 — EXPLICIT PRESERVATION, PRODUCT SHOT
Change only the background behind the watch. Do not alter the watch
itself in any way: not its color, its reflections, its position, its
angle, or its existing shadow on the surface directly beneath it.
New background: matte charcoal sweep, single soft top light.
19 — EXPLICIT PRESERVATION, GROUP PHOTO
Change only the wall and floor behind the four people. Do not change
any person's pose, expression, clothing, or the lighting already falling
on their faces. New background: exposed-brick office wall, warm ambient
light matching the room they were actually photographed in.
How do you keep perspective and the horizon line consistent?
A background that's geometrically wrong reads as fake even when the lighting is perfect. Match camera height to the subject's own eye level or lens height, and put the horizon line where it would actually fall given how the subject was photographed, not wherever looks nice.
20 — HORIZON AT THE SUBJECT'S EYE LEVEL
Background: open field with a distant tree line. Horizon line positioned
at the subject's eye level, consistent with a camera held at standing
eye height. Camera perspective straight-on, no upward or downward tilt
introduced.
21 — VANISHING POINT MATCHING FOR A PRODUCT SHOT
Background: a warehouse aisle receding into the distance. Vanishing
point centered directly behind the product, floor lines converging at
the same height as the product's own base, matching the flat, straight-on
angle the product was originally photographed at.
How do you get realistic shadows and contact points?
The single biggest tell of a fake composite is a missing or mismatched contact shadow, the small, dark, sharp-edged shadow exactly where an object touches its surface, as distinct from a longer cast shadow. Ask for both, and tell the model which direction the cast shadow should fall relative to your stated light source.
22 — CONTACT SHADOW ON A GLOSSY SURFACE
New background: dark glossy tabletop. Add a tight, soft contact shadow
directly beneath the product's base where it touches the surface, plus
a longer, softer cast shadow falling to the right, consistent with a
light source from upper-left. Include a faint reflection of the product
in the glossy surface.
23 — CONTACT SHADOW FOR A STANDING SUBJECT
New background: sunlit concrete plaza. Add a hard-edged contact shadow
directly under the subject's feet, plus a longer cast shadow extending
behind them at a low angle, matching a low afternoon sun from camera-left.
No floating appearance at the feet.
How do you stop a background replacement from looking "pasted on"?
Every failure mode above compounds, so the "pasted on" look is rarely one mistake, it's usually two or three at once: a light-direction mismatch plus a missing contact shadow, or a hard hairline edge plus a horizon sitting at the wrong height. Run the checklist in order before you accept a result: does the light direction and color temperature match, are fine edges soft rather than cut, is there a contact shadow at every point the subject touches a surface, and does the horizon or vanishing point sit where the original camera angle would put it.
24 — THE "EVERYTHING AT ONCE" TEST CASE
Full-body subject on a windy hilltop background. Match: warm 4000K
low-sun light from camera-right on the subject's existing highlights,
a soft contact shadow directly beneath both feet plus a longer cast
shadow to the left, horizon line at the subject's mid-thigh height
consistent with the original low camera angle, and individually
rendered wind-blown flyaway hair strands rather than a hard silhouette.
Where this fits
We build the prompt, not the image. Prompt Architects doesn't edit or generate pictures itself: it turns a rough description into the structured wording above, so you paste it into whichever tool actually matches your workflow, a masked editor, a reference-image model, or a text-only regenerator, rather than rewriting the same instructions by hand every time your client wants a different backdrop.
If you're working specifically in Midjourney, our Midjourney background prompts guide covers that tool's own parameters in more depth than fits here. And if a background swap keeps producing the wrong subject entirely rather than just a rough edge, that's a distinct failure mode with its own fixes. The free plan includes 5 prompt enhancements a day, forever, per our FAQ, which is enough to test every pattern on this page before deciding whether you need more.
Stop rewriting prompts. Start shipping.
Works with ChatGPT, Claude, Gemini, Grok, Midjourney, Ideogram, Veo3 & Kling. 5.0★ on the Chrome Web Store.
Create An Account