Sub topic 5
Removing and Replacing Objects with Generative Fill
This chapter assumes that you can make selections, use the Layers panel, and work with layer masks. It also assumes that your Photoshop installation includes Generative Fill and that you are signed in to an Adobe account. The exact labels may differ slightly between Photoshop versions.
Generative Fill can remove an object, replace it with something else, or rebuild the area around it. The main control is the selection. Photoshop uses the selected area and nearby pixels as context for the generated result.
Removing an object with an empty prompt
An empty prompt tells Photoshop that you want it to fill the selection without adding a named object. Photoshop analyzes nearby texture, color, lighting, and perspective. It then creates pixels intended to continue the surrounding scene.
Use this workflow:
- Open the image and duplicate the original layer if you want a separate backup.
- Select the object with the Object Selection, Lasso, or another selection tool.
- Include a small amount of the object’s edge in the selection. A selection that stops inside the object can leave a visible outline.
- Use Select and Mask or a feather of about 1 to 3 pixels when the image resolution supports it.
- Open the Contextual Task Bar and choose Generative Fill.
- Leave the prompt field empty.
- Choose Generate.
- Review the variations in the Contextual Task Bar or Properties panel.
The selection should cover the complete object, including contact shadows, reflections, and small attached details. If you remove a person standing on a floor but exclude the person’s shadow, the shadow may remain.
Replacing an object with a prompt
To replace an object, select the old object and describe the new content. For example, select a vase and enter “a small ceramic bowl with blue geometric patterns.” Photoshop uses the selection as the target area and the surrounding image as context.
A useful replacement prompt identifies the subject and, when needed, its appearance or position:
- Subject: “a red bicycle”
- Material: “a weathered wooden bench”
- Appearance: “a black leather backpack”
- Scene relationship: “a folded cream blanket resting on the chair”
Avoid describing unrelated parts of the image. The prompt should tell Photoshop what belongs inside the selected area, while the image provides lighting and composition.
A replacement may need more room than the original object. If the selection is too small, Photoshop may crop the new subject or distort it. Select a slightly larger area when the new object needs space, but avoid selecting important nearby details that should remain unchanged.
Selection strategy and context
Generative Fill works from two kinds of information:
- The selected area defines where Photoshop may create or replace pixels.
- The unselected area provides visual context for edges, lighting, texture, and perspective.
For removal, select the object and its immediate visual effects. For replacement, select enough space for the new object and include the old object completely. For a clean background, use a selection that follows the object’s outer contour rather than a large rectangle.
The following decision path helps choose the operation:
Checking and correcting the result
Zoom in after generation, but also inspect the image at its normal viewing size. Look for repeated patterns, melted edges, incorrect shadows, mismatched grain, or objects that appear to float. Compare the result with the original layer by toggling visibility when you kept a backup.
If the background is simple, a second generation with a better selection may solve the problem. If the generated area is mostly correct but has one bad edge, use a layer mask to hide that edge and reveal the original pixels beneath it. You can also make a smaller selection around the defect and generate again.
For a replacement, check whether the new object follows the scene’s light direction and perspective. Generative Fill can create plausible pixels without understanding the exact physical structure of the scene. A result can look convincing at a glance but fail when compared with nearby shadows or reflections.
Common errors
| Problem | Likely cause | Practical correction |
|---|---|---|
| A visible outline remains | The selection missed the object’s edge | Expand or redraw the selection |
| The shadow remains after removal | The shadow was outside the selection | Include the shadow and generate again |
| The replacement is cut off | The selected area is too small | Expand the selection before generating |
| The background contains repeated texture | The context is too limited or ambiguous | Select a cleaner region and use an empty prompt |
| The new object looks detached | Lighting or contact shadow does not match | Regenerate with a larger contextual selection |
Generative Fill creates suggestions, not guaranteed restorations. Keep the original image and treat each generated result as a version that you can compare, mask, or discard.
Exercise
You need to remove a street sign and its shadow from a photograph, then replace it with a flowering tree. Which two prompts should you use?
Show answer
First select the sign and its shadow and use an empty prompt to remove them. Then select a sufficiently large area and use a prompt such as “a small flowering tree rooted beside the sidewalk,” adjusting the selection if the tree is cropped.