Forum Discussion
How do you remove an unwanted person from a photo?
Hi everyone,
Got a few otherwise great photos, but there are random people in the background that I'd like to remove. Cropping isn't really an option because it would cut out important parts of the image.
Are AI object-removal tools good enough to remove an unwanted person from a photo and naturally rebuild the background now? Looking for something beginner-friendly that doesn't leave obvious blur, strange patterns, or other editing artifacts.
What tool or method would you recommend for removing remove a person from a photo?
10 Replies
- GaupBronze Contributor
To remove a person from a photo, use the best selection tool you have, and zoom in to work on the edge details. Feather your selection slightly to avoid hard cutoffs.
- NaominyTin Contributor
The Criminisi Algorithm - This algorithm was designed specifically for object removal and region filling. It works by intelligently filling in the gap left behind after you remove a person from a photo.
- Patch-Based Approach: Instead of treating the gap as a whole, it fills the empty space patch by patch. It looks at the boundary of the removed area and finds the best-matching "patch" of pixels from the surrounding background to copy into the hole .
- Smart Prioritization: Its key strength is its priority system. It prioritizes filling areas where linear structures (like lines or edges) enter the gap, ensuring that important features like the edge of a wall or a straight line are reconstructed correctly and realistically before filling in the less structured areas. This helps avoid blurry or unnatural results.
How to Proceed:
- If you are determined to try it, the most straightforward path is to find a working code implementation on a platform like GitHub and follow its setup instructions. It is certainly a "challenging or complex free method" that fits your criteria, but it requires a significant time investment in technical setup and troubleshooting.
What to Consider Before Using It:
- Implementation Required: To remove a person from a photo with this algorithm, you must find and run an existing implementation. Several open-source projects on GitHub provide this, but they are designed for developers.
- Technical Skills Needed: You will typically need to run code in Python or C++ and be comfortable with the command line. One implementation notes that it takes a long time to process higher-resolution images.
- SyamterIron Contributor
Here is a step-by-step guide on how to remove a person from a photo via DORS. This is a complex, research-level tool designed for dense scenes with multiple similar objects .
1. Prepare Your Inputs: You need two files:
- Image: The source image containing the person.
- Mask: A binary mask image where the person to be removed is filled with white (255) and the rest of the image is black (0) . The image and mask must be the same dimensions and perfectly aligned.
2. Configure the Script: Open the run_inference .py file in the DORS folder and edit the following lines to point to your image and mask files:
python
IMAGE_PATH = "/path/to/your_image .png"
MASK_PATH = "/path/to/your_mask .png"
3. Execute the Script: Run the inference script from your terminal. The process will begin denoising and generate the output image with the person removed.
bash
python run_inference .py
What to Keep in Mind if Learn How to Remove a Person from a photo:
- Designed for Dense Scenes: DORS excels at removing a person from a photo when there are other similar people or objects nearby that might confuse other removal methods .
- Resource Intensive: According to the paper, the full DORS process requires approximately 10.50GB of VRAM and takes about 4.85 seconds per image on a capable GPU .
- Plug-and-Play: DORS is designed to be used without any training or fine-tuning. It works by modifying the attention mechanism during the image generation process .
- Research Tool: This is a project from an academic paper . It is intended for research and development purposes, and its interface is technical rather than user-friendly.
- AadyaoouTin Contributor
GrabCut is an excellent choice for this task, but it's not a one-click solution. It's an interactive, iterative algorithm designed to remove a person from a photo or extract any foreground object with user guidance.
To successfully remove a person from a photo, GrabCut uses a two-part workflow:
1: Prepare Your Environment
bash
pip install opencv-python numpy
2: Execute the GrabCut Algorithm for Person Removal
Here's a concise Python script to remove a person from a photo. The key is that it performs the segmentation part of the job.
python
import cv2
import numpy as np
# 1. Load the image
img = cv2.imread('your_photo.jpg')
if img is None:
print("Error: Could not load image.")
exit()
# 2. Initialize variables for GrabCut
mask = np.zeros(img.shape[:2], np.uint8)
bgd_model = np.zeros((1, 65), np.float64)
fgd_model = np.zeros((1, 65), np.float64)
To successfully remove a person from a photo and get a clean result, you need to be aware of the following:
- The Inpainting Challenge: The above code extracts the person. To actually remove them, you need to replace the extracted area with background. This can be done using Open CV's cv2 .inpaint() function on the original image using the foreground_mask to define the region to fill .
- ROI Selection is Critical: The algorithm's success heavily depends on the initial rectangle you draw. The rectangle must tightly enclose the target object without cutting off any parts .
- Iterative Refinement: For complex backgrounds or fine details, the algorithm may need manual refinement. You can iteratively provide "hints" by updating the mask with cv2.GC_FGD (foreground) or cv2.GC_BGD (background) pixels and re-running cv2.grabCut in cv2.GC_INIT_WITH_MASK mode .
- Python Requirement: GrabCut is an OpenCV algorithm, which requires a Python environment. It is not a standalone executable application .
- PopteriTin Contributor
Yes, you can use Pinta to remove a person from a photo, and it's a completely free option. Pinta works well for this task because it includes the essential manual editing tools needed for object removal, primarily the Clone Stamp and selection tools.
How to remove a person from a photo
The Clone Stamp tool is your primary tool for this job. It works by copying pixels from one part of the image and painting them over the person you want to remove.
Step 1: Select the Clone Stamp tool from the Tools menu.
Step 2: Adjust the brush size using the drop-down in the Tools Settings Bar to match the area you're working on.
Step 3: Set a sample point. Hold the CTRL key and click on an area of the image that is clean and representative of what should be behind the person. This sets the source for the pixels you will paint with.
Step 4: Paint over the person. Click and drag over the person you wish to remove, using the sampled background to "clone" over them. You will need to set new sample points frequently as you move to different areas to ensure the texture and lighting match.
How to remove a person from a photo? Pinta is your most effective, free, and straightforward option. It requires patience and practice to master, but for a free, non-AI tool, it offers a powerful and completely manual way to achieve this result.
- saleha15Brass Contributor
Yes, AI object-removal tools have gotten surprisingly good, especially when the person is in the background and the surrounding area has enough visual information for the tool to reconstruct.
For a beginner, I'd start with an object-removal/inpainting tool rather than trying to manually clone the background. Just brush over the unwanted person, let the AI generate the replacement, and then inspect the edges and nearby details.
The results can be excellent for simple backgrounds like walls, roads, skies, or landscapes. Busy backgrounds can still produce artifacts, so I usually recommend doing smaller selections and making a few passes rather than removing a large area all at once.
- MateoRodriguezIron Contributor
When you need to remove people from photos with professional-level results, Krita paired with the Segment Anything Model plugin offers a revolutionary open-source solution.
Based on AI-powered fill-in and restoration technology, it is undoubtedly the ultimate tool for users who want to learn how to remove a person from a photo without relying on expensive subscription services or automatic color detection.
Key Points:
- There no need to carefully outline the subject. SAM AI automatically and accurately outlines the subject, while the software uses a local AI model to seamlessly reconstruct the background.
- Youll need to install a plugin from GitHub, which may be slightly more technical for complete beginners compared to one-click web-based tools.
How to Remove a Person from a Photo
- Download the software from the official website → Install the free Krita AI Diffusion / SAM plugin from GitHub
- Open the image in the software → Click once on the unwanted figure in the background
- Let SAM AI automatically outline its precise contours → Click Inpaint
- and let the software use the local AI model to reconstruct the background beneath the selection.
All in all, this solution is an ideal, powerful, and lightweight tool for tackling complex editing tasks.
Although it lacks the ease of use found in modern commercial software, it’s a tool that delivers high-quality results without the need for expensive off-the-shelf software.
- NicholasLewisIron Contributor
You can simply use the open-source AI model IOPaint, which runs locally on your Windows computer via a simple web browser interface. The tool excels at removing people from photos because it is based on the LaMa model, which is designed to seamlessly handle high-resolution photos as well as structural textures such as waves, brick walls, or vegetation. As a powerful solution for how to remove a person from a photo, it requires no subscription fees or cloud uploads.
How to Remove a Person from a Photo
Step 1: Install the software locally using the installer EXE or a PowerShell command:
pip install iopaint
Step 2: Open the interface in your browser—it will run offline within the software.
Step 3: Import a photo into the application.
Step 4: Use the brush tool to paint over the people you want to remove.
Finally, release the mouse button, and the AI will instantly remove that person and reconstruct the missing background.
The software is open source. Its local processing capabilities ensure that your photos never leave your computer, making it ideal for users who value privacy and need to remove people from their photos with professional-quality results.
Pros:
- Open source
- Browser-based interface
- No watermarks, no usage restrictions
Cons:
- Requires technical setup
- Requires a high-performance GPU for optimal performance
- No mobile or cloud versions available at this time
- FabianHanTin Contributor
Removing unwanted people from a photo can be useful when you want a cleaner background or a more focused image. Cleanup.pictures provides a simple editing method for users who need to remove a person from a photo without complicated editing steps.
P.S.
- Use a clear, high-quality photo for better results.
- Check the edited area before saving.
How to use:
- Upload your photo.
- Use the brush to mark the person you want to remove.
- Let the tool process the selected area.
- Check the result and make adjustments if needed.
- Save the edited image.
With this method, remove a person from a photo becomes quick and easy, especially for simple background edits.
Disadvantages:
- Results may vary with complex backgrounds.
- Some areas may need additional correction.
- DylanTaylorIron Contributor
Removing unwanted people from a photo can be useful when cleaning up travel pictures, group shots, or backgrounds with accidental bystanders. Users who want to edit an image without manually rebuilding every part of the scene may search for remove a person from a photo to find a suitable solution.
Stable Diffusion WebUI is an interface for working with AI-based image generation and editing models. With the appropriate inpainting model and settings, it can help modify selected areas of an image while generating replacement details that better match the surrounding background. This makes it useful for creative retouching and other image-editing tasks.
The usual process is to load the original image, select the area containing the unwanted person, and use an inpainting workflow to generate a replacement. Users can adjust the mask, prompt, and generation settings until the result looks natural, then save the edited image. For those looking for remove a person from a photo, this approach offers more control over the editing process.