Instruments & Meters

Image Cleanup Case Shows Why Processed Product Photos Need an Independent Text Reference

Adaeze NwosuOctober 25, 20265 min read6 views

At a glance

  • A small e-commerce image workflow found that plausible-looking generative edits can alter mandatory carton text, prompting a deterministic pipeline and two-check verification.
  • A case study of carton back-panel photos found that a generative image model changed digits and punctuation despite instructions to preserve text. The team switched to deterministic processing, kept an early reference image, and compared outputs with OCR and pixel-level ink checks before publication.
An editorial illustration of a carton back panel being compared with a separate reference image and a pixel-level check on a neutral studio surface.

A small image-processing project for online product pages has underlined a quality-control principle: when an image carries legally required text, the printed characters are the measurement target, not the visual polish of the final picture.

The case, described by Justin Flick of SOMUVA UG, involved turning phone photos of carton back panels into straightened images on a white background. The panels contained manufacturer and importer details, warning texts and contact information. The images could be improved, but the information had to remain identical.

A plausible result that failed the text check

The first attempt used a generative image model. Although the prompt required every printed character, number and symbol to stay the same, the output looked professional while changing “2801” to “2001,” altering digits in a phone number, and swapping a comma and a full stop in different places. Because the changes were plausible, they were not easy to catch at a glance. The generated images were discarded and none was published.

The lesson was that a generative model produces text that looks plausible, not necessarily the text that was printed. Visual inspection is a weak control against plausible errors, so it cannot serve as the reference.

Deterministic processing keeps photographed pixels

The replacement workflow used a deterministic chain. The carton face was rectified with a perspective transform from four corner points. Uneven lighting was flattened by estimating background illumination and dividing it out, followed by white balancing to a target tone. Denoising was kept gentle and edge-preserving. Text blocks were marked as protected regions so their pixels passed through background clean-up unchanged. The result was then placed on a white background with a soft shadow. Nothing on the carton was redrawn or re-typeset; every character in the final panel came from photographed pixels.

Two checks against an early reference

For each image, the team kept a reference made from the same crop after rectification and the illumination and white-balance steps, but before denoising or clean-up. Each processed carton face was compared with that reference before being placed on the background. The first check was an OCR diff: both images were read by an open-source OCR engine with German and English language data after upscaling, and the resulting word sequences were aligned to list deviations.

The second was an ink check that did not depend on reading text. Pixels clearly darker than the carton background in the reference counted as print. If such pixels became light in the processed image and most of a connected group disappeared, the group was flagged as a lost character.

The gate showed that classical filters are not automatically safe. A speckle filter turned “130” into “30” and removed colons. A threshold clean-up step erased the dot in a web address. Both stages were dropped. The team’s conclusion was that any step deciding what counts as noise can also decide that a full stop is noise.

OCR has its own measurement uncertainty

An OCR diff is itself a measurement system with its own error. On small print, it misread the reference image as well, for example reading a “5” as an “S.” A raw OCR diff therefore reports disagreements that the processing did not cause. Taken at face value, these create false rejects; ignored wholesale, they hide real changes and create false accepts.

The team compared this with a gauge study: before attributing variation to the part, the variation of the measurement system must be separated out. In this case, OCR misreads of the reference had to be distinguished from changes introduced by processing. A second, independent principle—the ink check—and a separate review step did that work. The operating rule was to treat each disagreement as a stop to be resolved, not as a similarity score to be averaged away.

Second review, backups and the published file

A separate automated review, independent of the processing chain, checked the images in two rounds. In the first round, a composite image failed because one inserted line could not be verified reliably; it was removed and the genuine information block from the carton was used instead. Previous states were backed up before any image was replaced. After publication, the delivered files were downloaded and compared with the team’s own copies; at reduced resolution, the mean absolute greyscale difference was well under one grey level.

Practical rules for quality teams

  • Define the measurand: for mandatory text, characters matter more than appearance.
  • Keep a separate reference from the earliest reliable processing step and never compare an output only with itself.
  • Use at least two measurement principles, such as an OCR text diff and a pixel-level ink check.
  • Characterize OCR errors on the reference before trusting its verdicts.
  • Treat any disagreement as a stop, and test classical filters as rigorously as AI tools.
  • Add an independent second review, remove what cannot be verified, and back up before every change.
  • Pixel-compare published files, and improve input with frontal, unwrapped, frame-filling daylight photos.

Generative models remain useful for images where nothing has to be read. For images carrying mandatory information, the team now uses classical processing plus a text comparison against the original.

Reported by Adaeze Nwosu, Electrical test and safety editor.