In-painting (usually written inpainting in research and software documentation) is the reconstruction of a selected area of an image so that the result looks continuous with everything around it. A user marks the region to change - a stray cable, a logo, a background - and software generates replacement pixels for that region alone. It exists because most images are almost right, and in-painting fixes the one wrong element without a reshoot. In advertising it is the mechanism behind "erase object", "replace background" and "add object" buttons in the creative tools of Google, Meta, Amazon, Microsoft and Adobe.
How in-painting works
Every in-painting operation has three inputs: the original image, a mask and, in generative systems, an optional text prompt. The mask is a second image of the same dimensions that records which pixels may change. Conventions differ by vendor. In the open-source Diffusers library used to run Stable Diffusion, white mask pixels are repainted and black pixels are preserved, according to its documentation. Amazon's Titan Image Generator on Bedrock uses the opposite convention: a pixel set to (0, 0, 0) is inside the mask and (255, 255, 255) is outside, according to AWS. OpenAI's image edit endpoint reads transparency instead, editing the "fully transparent areas (e.g. where alpha is zero)" of a PNG that must be under 4MB and match the source image's dimensions, according to its API reference.
Masks can be drawn or inferred. Google Ads' image editor pre-selects objects an advertiser can pick "with a mouse-click" and offers rectangle and brush tools, according to Google. Titan accepts either a painted maskImage or a maskPrompt, a phrase such as "windows" from which the model infers the region.
The fill is where the methods diverge.
- Diffusion models, which dominate current tools, start from random noise in the masked area and remove it over a series of steps, conditioning each step on the unmasked pixels and the prompt. The Stable Diffusion inpainting model released by Runway in 2022 added five input channels to its neural network - four for the encoded masked image and one for the mask - and was trained for 440,000 steps at 512x512 pixels on synthetic masks, a quarter of which covered the entire image, according to its model card.
- A strength parameter controls how far the output may depart from what was there. In Diffusers, a value of 1.0 "essentially ignores the masked portion" of the original, so the region is generated from scratch; lower values keep more of its structure.
- Compositing pastes the generated region back into the original so unmasked pixels stay identical. Systems that regenerate the whole frame and treat the mask as a hint offer no such guarantee.
Outpainting is the same operation pointed outward. The mask protects the original picture and the model generates new content beyond its borders, which is how a square product shot becomes a 9:16 Reels asset. Titan's outPaintingMode exposes the trade-off directly: PRECISE forbids any change inside the protected region, while DEFAULT allows small changes so the seam blends.
Who operates it in advertising
In-painting now sits inside the ad platforms, not only in design software such as Photoshop. Google began a beta of AI image editing in the Google Ads asset library on January 2, 2025, with six functions: background replacement, object erasure, adding objects, replacing objects, image expansion and colour adjustment. Those tools moved into Asset Studio, launched on September 10, 2025, with bulk editing of up to 100 images at once. Manual prompting requires an account that has run ads for at least 30 days and excludes election advertisers and sensitive verticals, according to Google.
Meta began rolling out background generation and image expansion in the US on October 4, 2023, alongside text variations, with global availability promised for 2024, according to SiliconANGLE. Its Marketing API later exposed both, with background generation limited to Advantage+ catalog ads. Microsoft Advertising exposes a BackgroundChange refine operation through its API, according to its developer guide.
In shopping feeds, Google Merchant Center's optional image improvement removes "text, watermarks, overlays, or logos" from product photos, according to Google. It is off by default.
Origin and evolution
The word comes from art conservation, where restorers paint in losses on damaged canvases. Marcelo Bertalmio, Guillermo Sapiro, Vicent Caselles and Coloma Ballester carried it into computing with "Image Inpainting", a 2000 SIGGRAPH technical paper. Their algorithm propagated isophote lines (lines of equal brightness) inward from the boundary of a selected region and was designed to "replicate the basic techniques used by professional restorators", according to the SIGGRAPH history archive. Its stated uses included removing dates, subtitles, microphones or wires.
Such methods handled scratches but smeared large holes. Exemplar-based methods instead copied patches of real texture from elsewhere in the image. Connelly Barnes and colleagues at Princeton and Adobe published PatchMatch, a fast randomised patch-matching algorithm, which shipped in Photoshop CS5 in 2010 as Content-Aware Fill, according to Princeton's technical report archive. Patch copying could only reuse what the image already contained.
Deep learning changed that. "Context Encoders", posted to arXiv by Deepak Pathak and co-authors on April 25, 2016, trained a network to predict missing image centres. LaMa, submitted on September 15, 2021, used fast Fourier convolutions to handle large masks. In April 2022 OpenAI's DALL-E 2 let users select part of an existing picture and edit it with text, removing objects while accounting for shadows, according to SiliconANGLE. Stable Diffusion's dedicated inpainting checkpoint followed later in 2022, putting the capability in open weights.
Commercial adoption came in 2023. Adobe released Generative Fill in the Photoshop beta on May 23, 2023, describing it as a way to "add, extend, or remove" content with text prompts. Firefly became available for commercial use on September 13, 2023, after a beta of more than two billion generations, according to Adobe. Black Forest Labs released FLUX.1 Fill, an inpainting and outpainting model with open-weight and API versions, on November 21, 2024.
The latest shift is toward instruction-based editing, in which a multimodal model takes a sentence such as "change the background to a snowy street" and decides for itself what to alter. Google's Nano Banana Pro, announced on November 20, 2025, brought localised edits and conversational editing to Asset Studio. With OpenAI's GPT image models, "masking with GPT Image is entirely prompt-based", unlike with DALL-E 2, according to OpenAI documentation quoted on its developer forum.
Why it matters for marketers
A single product photograph can be adapted to dozens of placements, seasons and audiences by changing what surrounds the product. Aspect ratios multiply across placements while photography budgets do not, which is why background replacement and outpainting are the edits platforms automate most. The same capability shifts control: when the platform runs the edit, the brand may not see the output before it serves.
Limitations and disputes
Product fidelity. In-painting invents pixels, and invented pixels can be wrong. In June 2026 REI removed an Instagram ad after an AI tool altered a vendor's bicycle photograph, adding a second set of handlebars, dropping a crank arm and moving the disc brakes to the wrong side; REI said Meta had "auto-enrolled us in an AI personalization tool". The feature was not publicly identified.
Masks that are not respected. Developers have reported that OpenAI's gpt-image-1 treated masks as guidance and changed pixels outside them. A forum post of August 19, 2025, titled "Mask is completely ignored in the image edit api", drew replies calling it a known limitation. A hard mask preserves a logo pixel for pixel; a soft one may not.
Disclosure thresholds. Whether an in-painted ad counts as AI-generated is unsettled. Article 50(2) of the EU AI Act, which applies from August 2, 2026, exempts AI systems that "perform an assistive function for standard editing or do not substantially alter the input data", according to the regulation's text. The text does not say where removing a cable ends and substantial alteration begins. Google's label setting is binary - advertisers choose "Label this asset as created or edited with AI" or no label - and Google attaches SynthID watermarks and open-standard markup to all images generated in its ads editor, according to its help documentation.
Abuse. The same technique underlies "nudify" apps that replace clothing in photographs of real people. Meta sued Joy Timeline HK, the company behind Crush AI, in Hong Kong in June 2025; the app reportedly ran more than 8,000 ads in the first two weeks of 2025, according to TechCrunch, citing Alexios Mantzarlis of the Faked Up newsletter.
In-painting versus adjacent terms
- Outpainting extends an image beyond its frame; in-painting changes pixels inside it. Ad platforms often call it "image expansion".
- Text-to-image generation creates an entire picture from a prompt with no source image.
- Background removal cuts the subject out and leaves transparency, a segmentation task that generates nothing. Background replacement goes further and in-paints a new scene.
- Deepfake describes an outcome - synthetic media that falsely depicts a real person or event - rather than a technique. In-painting can produce one.
Recent developments
Google added video generation and one-click creative testing to Asset Studio at Google Marketing Live on May 20, 2026. At Cannes in June 2026, Meta presented an end-to-end creative system with "brand memory". In the EU, the Commission published Article 50 guidelines and a voluntary Code of Practice on July 20, 2026, giving generative AI providers already on the market until December 2, 2026 to bring machine-readable marking into line. OpenAI's API reference, as of October 2026, lists gpt-image-1 as shut down on October 23, 2026, with gpt-image-2.5 models as replacements.
Timeline
- 2000 - Bertalmio, Sapiro, Caselles and Ballester present "Image Inpainting" at SIGGRAPH.
- 2010 - Photoshop CS5 ships Content-Aware Fill, based on PatchMatch.
- April 25, 2016 - "Context Encoders: Feature Learning by Inpainting" is posted to arXiv.
- September 15, 2021 - LaMa large-mask inpainting paper is submitted to arXiv.
- April 6, 2022 - DALL-E 2 is announced with text-guided editing of existing images.
- 2022 - Runway releases a Stable Diffusion inpainting checkpoint with open weights.
- May 23, 2023 - Adobe launches Generative Fill in the Photoshop beta.
- September 13, 2023 - Adobe Firefly becomes available for commercial use.
- October 4, 2023 - Meta begins rolling out background generation and image expansion for ads in the US.
- November 21, 2024 - Black Forest Labs releases FLUX.1 Fill.
- January 2, 2025 - Google Ads begins a beta of AI image editing in its asset library.
- June 12, 2025 - Meta sues the maker of the Crush AI nudify app.
- September 10, 2025 - Google launches Asset Studio.
- November 20, 2025 - Google announces Nano Banana Pro.
- June 22, 2026 - REI pulls an Instagram ad altered by an AI tool.
- August 2, 2026 - EU AI Act Article 50 transparency obligations apply.
- October 23, 2026 - OpenAI shuts down gpt-image-1, according to its API reference.
- December 2, 2026 - Deadline for existing generative AI providers to conform machine-readable marking under Article 50.
Related PPC Land coverage
- Google introduces AI image editing capabilities for Ads asset library - The January 2025 beta with object erasure, replacement and image expansion.
- Google launches Asset Studio for advertising creative production - Google Ads' creative workspace built on Imagen 4 and Veo, with bulk editing.
- Google Ads Asset Studio beta now available to advertisers worldwide - The worldwide rollout of the beta.
- Google launches Nano Banana Pro image model for advertising - Localised and conversational image editing inside Asset Studio.
- Asset Studio gets Gemini Omni and 1-click creative testing at GML 2026 - Video generation and testing added in May 2026.
- REI's AI bike ad fiasco reveals a Meta auto-enrollment setting brands missed - A product photo distorted by an automated AI edit.
- Meta ad spend returns $4.13 per dollar as AI creative tools roll out at Cannes - Meta's June 2026 creative system and brand memory.
- Advertisers face mandatory AI ad labels across Google's five platforms - Google's binary "created or edited with AI" label.
- EU AI content rules force publishers to label or risk 3% of turnover - Article 50 guidelines, the Code of Practice and marking deadlines.
- Google requires transparency for AI-generated images in Merchant Center - IPTC metadata rules for AI-generated product images.
- Explaining C2PA - The provenance standard used to record AI edits in image files.
- Explaining deepfake - Synthetic media depicting real people or events.
Summary
Who. Researchers who coined the computing term in 2000; Adobe, OpenAI, Stability AI, Runway, Black Forest Labs, Google and Amazon as model makers; Google, Meta and Microsoft as ad platforms embedding the feature; advertisers, agencies and retailers as users; and EU regulators setting disclosure rules.
What. A technique that regenerates a masked region of an image so it blends with the surrounding pixels, used to remove, replace or add objects and backgrounds, with outpainting as its outward-facing counterpart.
When. Introduced to computer graphics in 2000, commercialised through Content-Aware Fill in 2010, transformed by diffusion models in 2022 and built into ad platforms from 2023 onward.
Where. In Photoshop and Firefly, in model APIs such as Titan, FLUX.1 Fill and OpenAI's image edit endpoint, and in Google Ads Asset Studio, Meta Advantage+ creative, Microsoft Advertising and Merchant Center.
Why. It lets one photograph serve many placements and audiences without a reshoot, which is why platforms automate it, and why product accuracy, mask reliability and AI disclosure have become contested.
Discussion