DEV Community

Saihhold Zhao
Saihhold Zhao

Posted on

How to Edit Text in an Image with AI (and Keep the Original Font)

You have a flat image — a screenshot, a poster, a photographed menu — and one word in it is wrong. No PSD, no layers, no idea what font it uses. The classic fix is opening Photoshop, cloning out the old text, guessing the font with Match Font, and nudging kerning until it looks right. For a one-word change, that's a lot.

This post walks through the faster workflow I now use: AI-based in-place text replacement. I'll use Retypit, a browser tool built specifically to edit text in an image while keeping the same font, color and style.

Why this is harder than it looks

Changing text inside a raster image is really three problems:

  1. Finding the text — the image is just pixels; there's no text layer.
  2. Removing the old words without leaving a smudge on the background, texture, or gradient behind them.
  3. Re-rendering the new words so they match the original typeface, weight, color, shadow and wear.

General-purpose generative fill tends to fail on step 3: it regenerates a whole region and the letters come back in a generic sans-serif, or slightly garbled. A dedicated tool handles all three steps together and touches only the line you changed.

Step 1: Upload the image

Go to retypit.ai and drop in a PNG, JPG or WebP (up to 20 MB). You'll need to sign in (Google or email). The tool detects every line of text automatically and puts a marker on each one, with an editable list beside the image.

Tip: use the highest-resolution version you have. Detection and re-rendering both work better with crisp letterforms.

Step 2: Click the line and retype it

Select the line you want to change and type the replacement. Some examples from my own use:

  • A flyer: SUMMER → WINTER, SAT JUL 12 · 7PM → SUN JAN 18 · 4PM
  • A menu photo: $14 → $19 across several prices
  • A UI screenshot: fixing a button label for docs without rebuilding the UI

You can change several lines in one go, then press Edit text.

Step 3: Download

The AI rebuilds the new words in the original lettering — font, color and texture — and leaves faces, backgrounds and layout alone. That "only the text changes" behavior is the main reason I use it as an AI image text editor instead of a generic inpainting model. Download the result and you're done.

Use cases where this shines

  • Screenshots for docs and tutorials. If you write technical docs, you know the pain of a typo in a screenshot of a UI you can't easily reproduce. You can edit text in a screenshot instead of re-capturing it.
  • Fixing typos in AI-generated images. Image models still misspell words. Correcting one word beats rerolling the whole scene and losing the composition you liked.
  • Posters, flyers and menus. Reusing last month's event poster with a new date, or updating prices on a photographed menu.
  • Product photos. Swapping label text on packaging mockups.
  • Memes and social graphics. Retyping captions while keeping the original look.

When to still use Photoshop

To be fair: this is not a Photoshop replacement. If you need full compositing, layout changes, or you actually have the layered source file, use your design tool. And it's not a font identifier — if you need to know the font's name, use a font-ID tool. The sweet spot is: you only have the flat image, and you just need to change text in a photo so it looks like it was always there.

Also worth knowing: the tool aims to change only the selected text, but minor changes elsewhere can occasionally happen, so zoom in and check edges before you ship the image.

Quick comparison

Approach Font match Background preserved Time for 1 word
Manual Photoshop (clone + Match Font) Depends on your skill Yes, if careful 10–30 min
Generic AI inpainting Often generic font Region is regenerated 1–2 min, many retries
Dedicated in-place text editor Matches original style Only the line changes Under a minute

Wrapping up

For one-off text fixes in flat images, a purpose-built tool saves a surprising amount of time. If you want to try it, Retypit lets you replace text in an image without Photoshop right in the browser. I'd love to hear in the comments what kinds of images you most often need to fix — screenshots? AI art? menus?

Top comments (0)