- Syntha AI
- Posts
- Inpainting and Outpainting. How to remove people and objects from a photo
Inpainting and Outpainting. How to remove people and objects from a photo
RunWay, DALLE 2, Stable Diffusion, and other tools
Let me guess: almost every time you make a photo of something there is somebody else in the background. You have two potential solutions to this problem: go to make a photo at 4 am or use AI. My newsletter is not about how to wake up like Dwayne Johnson, so let’s talk about AI methods for this.
So you have something in your photo you would like to replace. This task is called inpainting. You need to specify a region in a photo, and an AI model should inpaint it naturally. The challenge here comes from the fact that the model needs to “understand” what was behind the removed object.
Inpainting example from Google Photos. Image source: https://blog.google/products/photos/magic-eraser-android-ios-google-one/
In terms of AI, the inpainting task is usually solved using an image-to-image model. I.e. an image is used as both input and output. In order to create such a model, one needs to create a dataset of pairs [image with a missing part, image without a missing part]. Such a dataset can be created by randomly selecting regions on images for deletion. Then one needs to train an AI model to restore missing regions.
Image Outpainting
A similar, but different image processing problem is outpainting. It allows extending an existing image beyond its original boundaries while maintaining visual consistency. Look how outpainting can be used to extend existing images and merge them into a new big image:
Tools for inpainting and outpainting
Here is where to try inpainting and outpainting:
Google Photos for Pixels and Android/iOS Google One subscribers
DALLE 2 Web interface
Stable Diffusion in Hugging Face web interface
RunWay web image/video editor. It also allows you to erase objects from videos
Tool of the week
getim.ai is a tool for generating and editing images. It can do inpainting and outpainting of existing images based on text prompts.
Image source: getimg.ai
This is an affiliate link which means I will earn some money if you use the product.
News of the week
Last week Open AI introduced ChatGPT plugins. They will allow the integration of ChatGPT with existing apps and expand its functionality. For example, plugins can be used to connect ChatGPT to the internet, search for hotels and flights or reserve order goods.
Image source: https://openai.com/blog/chatgpt-plugins
I have not received access to the plugins yet but will share my experience as soon as possible.
Thank you for reading my newsletter. I would greatly appreciate any feedback you have: just reply to this email.
If you like my newsletter, feel free to share it on Twitter or just send a direct link to this post: https://syntha.beehiiv.com/p/inpainting-and-outpainting-how-to-remove-people-and-objects-from-a-photo.