DEV Community

Jakub
Jakub

Posted on

Restoring and animating a scanned black-and-white photo: the Živá Fotka pipeline

More than 10,000 photos have gone through our animation pipeline at Živá Fotka so far, with an average processing time of 18 seconds each. A good chunk of those started as scanned black-and-white prints from family albums, shoe boxes, and attic drawers. At Inithouse, a studio shipping a growing portfolio of products in parallel, we built this tool because static scans felt like the hardest input type to get right, and we wanted the output to look natural, not filtered.

Here is how the pipeline handles a scanned B&W photo from start to finish, where things tend to break, and what we did about it.

The job: scan to living video

Someone finds an old photograph. Maybe a grandparent's wedding, a family gathering from the 1970s, or a school portrait from decades ago. The photo is faded, possibly scratched, and black-and-white. They scan it (or photograph it with a phone), and they want two things: color, and movement. Not a slideshow transition or a Ken Burns effect. Actual motion, with eyes blinking, a subtle smile shift, a gentle head tilt.

That is the job Živá Fotka does. Here is the pipeline, step by step.

Step-by-step pipeline

1. Input normalization

The scan arrives in whatever quality the user's phone or flatbed scanner produced. We normalize resolution, correct rotation (EXIF + heuristic), and crop to a usable frame. Phone photos of printed photos are common (glare, perspective distortion), so the pipeline includes a de-warp pass before anything else.

2. Face detection and landmark mapping

We map 68+ facial landmarks: jawline, eyebrows, nose bridge, lip contour, eye corners. This is the foundation for natural-looking animation later. If the face is too small (under ~80px between eyes), too damaged, or turned past roughly 45 degrees, the pipeline flags it. More on failure modes below.

3. Damage assessment

Old scans have scratches, creases, foxing (brown spots), and sometimes missing sections right across a face. The pipeline scores damage density in the facial region specifically, because a scratch across the forehead matters more than one in the background. Light damage gets repaired in the next step. Heavy damage over key landmarks (eyes, mouth) gets flagged for the user.

4. Restoration and cleanup

Scratches, dust, and minor tears get inpainted. This is not a generic "denoise" filter. The restoration targets specific artifacts identified in step 3, preserving the original texture and grain where possible. We found early on that overly smooth restoration made the final animation look uncanny: a 1960s portrait with skin texture from a 2024 smartphone selfie does not convince anyone.

5. Colorization

This is where B&W becomes color. The model predicts plausible colors from grayscale values and learned context (skin tones, sky, clothing patterns of the era). "Plausible" is the key word. We cannot know that grandmother's dress was blue, not green. But we can produce a result that looks like a real color photograph from that period, not a hand-tinted postcard.

We measured colorization quality across hundreds of scans and noticed that photos from the 1940s through 1960s produce the most convincing results. Earlier photos (1900s-1930s) with different emulsion characteristics and later photos (1970s-1980s) that were already shot on early color film but faded to near-monochrome can be trickier.

6. Animation synthesis

With a restored, colorized face and 68+ mapped landmarks, the animation model generates motion. Not random warping. Physiologically plausible micro-movements: a blink cycle, slight head rotation, a breathing motion in the chest/shoulders if visible. The target is 3-4 seconds of smooth video at a quality where a viewer's first reaction is "that looks real," not "that looks animated."

7. Post-processing and export

Final color grading to match the era's look (no Instagram-filter feel), stabilization, and export as MP4. The user gets a short video they can share, save, or print as a lenticular if they want.

Where the pipeline fails (and what we do about it)

Not every scan produces a good result. After processing 10,000+ photos, clear patterns emerged:

Failure mode Why it happens How we handle it
Severely damaged face (missing eye, torn mouth area) Landmark detection cannot anchor to destroyed features Flag before processing; user sees a clear warning rather than a bad output
Strong profile view (>45 degrees) Animation model needs both eyes visible for natural blink synthesis Reduced animation (subtle movement only, no blink), with user notification
Multiple faces close together Landmark overlap between adjacent faces causes animation bleeding Process each face region independently; works for ~80% of group shots
Phone photo of a photo (glare, curvature) Specular highlights and warping confuse face detection De-warp pass (step 1) catches most cases; extreme glare still fails
Very low resolution scan (<300 DPI equivalent) Not enough pixel data for convincing landmark placement Upscale first, but warn the user that quality depends on input resolution
Infant or very young child Facial proportions differ enough that adult-trained landmarks misalign Separate child-face model handles most cases; newborns remain difficult

We took a similar approach with Pet Imagination, another product in our portfolio, where the input variability is even higher (try mapping facial landmarks on a Persian cat versus a Labrador). The lesson across both products: being honest about what fails and telling users upfront beats showing a bad result and hoping they will not notice.

The numbers

After running this pipeline across Živá Fotka for months:

  • 10,000+ photos processed
  • 4.8 out of 5 average rating from 1,200+ user reviews
  • 18 seconds average processing time (scan to finished video)
  • The tool runs in 5 languages across 5 domains (Czech, Slovak, Polish, English, German), and the scan restoration pipeline is the same everywhere

Colorization and animation of old family photos is one specific job Živá Fotka handles. The same pipeline processes modern color photos too (skip steps 3-5, go straight to landmark mapping and animation), but scanned B&W is where the engineering was hardest and where users seem most surprised by the result.

At Inithouse, a lab building many products at once, this is one of the products where user feedback consistently mentions the emotional reaction. Not "cool tech" but "I showed this to my mom and she cried." That is a signal we pay attention to, and it is why we keep tuning the restoration step specifically: getting the texture wrong on a grandmother's face is not a minor bug.

If you have scanned family photos sitting in a folder, try Živá Fotka.

Top comments (0)