Instruments & Meters

Carton Image Cleanup Shows Why Mandatory Text Needs an Independent Check

A retailer’s image-cleanup experiment found that generative edits could silently alter mandatory carton text, leading to a deterministic workflow with OCR and pixel-level checks.

Petra DahlbergOctober 25, 20265 min read8 views
An editorial illustration shows a carton back panel with indistinct printed blocks beside a reference image on a monitor and a magnifying loupe in a clean inspection setting.

A small online-retail case study argues that processed images carrying legally required text should be checked against an independent reference rather than judged by appearance. Justin Flick of SOMUVA UG, which runs the German-language shop vapechamp.de, described a workflow for turning phone photos of carton back panels into clean, straightened images on a white background for product pages. The panels carried manufacturer and importer names and addresses, warning texts and contact details such as phone numbers. The aim was to improve presentation without changing the printed information; in measurement terms, the measurand was the text, not the image’s appearance.

Generative edit produced plausible errors

The first attempt used a generative image model. Flick supplied a straightened carton image and explicitly instructed the model to keep every printed character, number and symbol identical. The output looked professional, with sharp print, even light and a clean background, but comparison with the source showed changes: the digits “2801” had become “2001,” a phone number contained wrong digits, and a comma had turned into a full stop while elsewhere a full stop became a comma. The changes were plausible and therefore hard to spot at a glance. Because the information was mandatory, the generated images were discarded and none was published. Flick concluded that a generative model produces what text plausibly looks like, not what was printed, and that visual inspection is too weak to serve as the reference.

Deterministic processing with a reference gate

The company replaced the model with 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 gentle and edge-preserving, and text blocks were marked as protected regions in which pixels passed through background clean-up unchanged. The result was placed on a white background with a soft shadow. Nothing on the carton was redrawn or re-typeset, so every character in the final image derived from the photographed pixels.

For each image, the team kept a reference: the same crop after rectification and the illumination and white-balance step only, before denoising or clean-up. Each processed carton face was compared with that reference before being placed on the background, using two measurement principles. An OCR diff read both images with an open-source engine using German and English language data after upscaling, aligned the word sequences and listed every deviation. A second, ink-based check did not depend on reading text: pixels clearly darker than the carton background in the reference counted as print, and if such pixels became light in the processed image and most of a connected group disappeared, the group was flagged as a lost character.

Classical filters and OCR need checks too

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

The OCR diff also had 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 the processing had not caused. Taken at face value, these could lead to false rejects; ignored wholesale, they could hide real changes and create false accepts. Flick compared the problem with a gauge study: variation from the measurement system must be separated before variation is attributed to the part. The independent ink check and a separate review step helped separate OCR misreads from processing-induced changes. He linked this to Gleb Tsipursky’s call to identify the source of a disagreement rather than assuming the person or model is wrong, and said each disagreement should be treated as a stop to resolve, not a similarity score to average away.

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 delivered files were downloaded and compared with the company’s own copies. At reduced resolution, the mean absolute greyscale difference was well under one grey level. Flick described the published file as the last link in the chain, deserving the same check as every earlier step.

Practical takeaways

Flick’s recommendations include defining the measurand; keeping a separate reference from the earliest reliable processing step; using two principles such as an OCR text diff and a pixel-level ink check; characterising OCR errors before trusting its verdicts; treating any disagreement as a stop; testing classical filters as rigorously as AI tools; adding an independent second review; backing up before changes; and pixel-comparing published files. He also advised improving input with frontal, unwrapped, frame-filling photos taken in daylight. Generative models remain useful where nothing has to be read, he wrote, but for images carrying mandatory information the company now uses classical processing plus a text comparison against the original. He applied Tsipursky’s question to processed images: when output and reference disagree, the answer should be known before anything is published.