Dev.to WebDev 🛠 Dev 👁 0 📖 2 min read

A Burned-In Date Stamp Isn't an Overlay: What Actually Goes to the Inpainting Model

A family scan from 1983 has "83 7 14" in orange in the bottom-right corner, and it is sharper than anything else in the frame. It looks stuck on. It isn't. A camera's date back burned those numerals onto the negative th

A Burned-In Date Stamp Isn't an Overlay: What Actually Goes to the Inpainting Model

A family scan from 1983 has "83 7 14" in orange in the bottom-right corner, and it is sharper than anything else in the frame. It looks stuck on. It isn't.

A camera's date back burned those numerals onto the negative through a small window. The scanner then read emulsion, digits and paper as one flat grid of colour values and handed you a single JPEG. There is nothing to lift off, so "removing" the date is really "reconstructing a patch from its surroundings".

I built a small free tool for that exact case. This post is the part I actually had to measure: how the region gets selected, what the model receives, and the two failure modes that ate most of my time.

Alabaster chapel of Amenhotep I, Karnak, 24 April 2005 — the camera's date back burned 2005.04.24 into the lower-right corner

A test frame with the problem baked in. Photo: Kingtut (Hungarian Wikipedia), via Wikimedia Commons, CC BY-SA 3.0.

What actually goes to the model

Numbers from that frame, 800×600:

  • stamp region: 165×38 px at (607, 526)
  • crop sent to the model: 495×114 px — the region is exactly 33.33% of the crop's width and height
  • the crop is then upscaled so its short side reaches 512, giving 2223×512 (4.49×)
  • round trip: 7,628 ms, no retries, stamp gone

The padding matters more than the upscale. The model needs clean material around the target to sample texture from; hand it a tight box and the material its output has to blend into isn't in the image at all. One third on each side is the ratio that survived my tests.

Failure mode 1: the model has nothing clean to copy

I first blamed upscaling for the leftovers on a printed receipt. That theory died fast: a 0.45 MP input failed while a larger one had already succeeded.

The variable that actually explains it is neighbourhood. When the selection sits inside dense strokes of the same weight and colour — a wall of printed body text — there are no clean reference pixels within reach, and resolution cannot buy them back. A short printed string boxed tightly on a single line behaves completely differently from a page of prose.

Which is why the honest scope is printed dates, timestamps, digits and short labels. Promise more and you earn a one-star review six months later.

Failure mode 2: a timeout that looks like model output

One 42-second request came back with a plausible, wrong patch. The model never answered: the call hit its timeout with retries disabled and the code fell back to a sample-based fill. On the client side that result is indistinguishable from a bad prediction, which means every future bug report lands on the wrong component.

If a pipeline has a retry budget and a fallback, log which of the two produced the pixels.

One rule for judging the output

Evaluate at the size the photo will be seen. At 200% every repair looks worse than it is; across a room, the over-edited one is the one that looks wrong first.

The tool is at dateerase.com — free, and it only does the case described above: dates, timestamps, digits and short printed labels inside the picture. EXIF is a different problem and a different tool.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.