A German online shop operator set out to turn phone photos of carton back panels into straight, clean product images on a white background. The panels carry manufacturer and importer names and addresses, warning texts and contact details, including phone numbers. The appearance could improve, but the printed information had to stay unchanged. In measurement terms, the target was the printed text, not the look of the image.
An initial attempt used a generative image model. The shop supplied a straightened carton image and instructed the model to keep every printed character, number and symbol identical. The output looked polished: sharp print, even lighting and a clean background. A comparison with the source found errors. The digits “2801” had become “2001”; a phone number contained wrong digits; a comma had become a full stop, and elsewhere a full stop had become a comma. The changes were plausible at a glance, which made visual inspection a weak check. Because the information was mandatory, the shop discarded the generated images and published none.
Deterministic processing keeps photographed pixels
The replacement was a deterministic chain, not a generative model. The carton face is rectified with a perspective transform from four corner points. Uneven lighting is flattened by estimating background illumination and dividing it out, followed by white balancing to a target tone. Denoising is gentle and edge-preserving. Text blocks are protected regions, so their pixels pass through background clean-up unchanged. The result is placed on a white background with a soft shadow. Nothing on the carton is redrawn or re-typeset; every character comes from the photographed pixels.
A reference image and two measurement principles
For each image, the shop kept a reference: the same crop after rectification and the illumination and white-balance step, 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; word sequences were aligned and deviations listed. 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 and most of a connected group disappeared, the group was flagged as a lost character.
The gate caught classical filters, too
The gate showed that conventional filters were not automatically safe. A speckle filter had turned “130” into “30” and removed colons. A threshold clean-up step had erased the dot in a web address. Both stages were dropped. Any step that decides what counts as noise can also decide that a full stop is noise.
OCR introduced its own measurement uncertainty. On small print, it misread the reference image, for example reading a “5” as an “S”. A raw OCR diff therefore reported disagreements that processing had not caused. Taken at face value, those could produce false rejects; ignored wholesale, they could hide real changes and produce false accepts. The shop separated OCR errors from processing changes using the ink check and a separate review, an approach it compared to a gauge study.
Second review and published-file check
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. The composite was removed and the genuine information block from the carton was used instead. Before any image was replaced, the previous state was backed up. After publication, the shop downloaded the files as delivered and compared them with its own. At reduced resolution, the mean absolute greyscale difference was well under one grey level.
What the case recommends
The shop distilled the case into steps for quality teams. Define the measurand: for images carrying mandatory text, characters matter more than appearance. Keep a reference from the earliest reliable processing step and never compare an output only with itself. Use two measurement principles, such as an OCR text diff and a pixel-level ink check. Characterise the OCR's own errors before trusting its verdicts. Treat any disagreement as a stop to be resolved, not a similarity score to be averaged away. Test classical filters as rigorously as AI tools. Add an independent second review and remove anything that cannot be verified. Back up before every change and pixel-compare the published files. Improve the input with frontal, unwrapped, frame-filling photos taken in daylight.
The shop still sees a role for generative models where nothing has to be read. For images with mandatory information, it now uses classical processing plus a text comparison against the original. The underlying question, it says, is the same one quality leaders face when machine and human judgment disagree: whether they know who was right, why, and what was changed afterward — before anything is published.
