← Back to work

Retail & e-commerce · Computer vision + AI

Color math decides, AI explains: auditing fabric accuracy in product photography

A color quality-control prototype for a home-furnishings retailer. Deterministic color science measures every image for free; a vision model is called only for flagged photos, to explain the problem, never to measure it.

Client
Home-furnishings retailer with a national online catalog
Engagement
Technology partner to a production and development agency
Scope
Color QA prototype: web, desktop, ingestion
Timeline
About a week to a working prototype, 2026
Role
Technical lead and developer

0

Correction values taken from the AI. Every number is recomputed from the pixels

~1 week

From kickoff to a working prototype in three forms: web app, desktop app and ingestion service

≈ 11 → < 2

Color difference (ΔE2000) on a showcase photo before and after a designer-approved correction

~10 ¢

Estimated AI cost per thousand images, because only flagged images ever reach the model

01

The problem

The same sofa, photographed years apart under different light, looks like two different products online, and customers believe it. The retailer’s image library covers tens of thousands of products and several generations of technique: studio photography, 3D renders and now AI-generated images, from many contributors over many years. Nobody was auditing color systematically, so mismatches surfaced as customer complaints.

An earlier attempt at automated retouching had changed product colors for the worse, so the team distrusted any tool that “fixes” color on its own. They needed a quality gate for new images and a way to audit the existing library, with a person making the final call.

02

Why it was hard

  • There is no single ground truth. The swatch is itself a photo and screens differ, so consistency across a product series matters as much as matching one reference.
  • Product photos are mostly background, shadows, legs, pillows and props. An average of the whole image measures the studio, not the fabric.
  • Textured fabrics are not one color, and whites, creams and grays shift with every change of light.
  • Vision models describe color problems well and produce unreliable numbers. Letting one output correction values invites exactly the failure the client had already lived through.

03

What we built

One analysis core with three ways in: a web app for analysts, a desktop app that pulls a product’s images straight from the live store in one click, and an ingestion service for batches of product pages. Every image gets a free, deterministic color measurement; only the flagged ones go any further.

Product images: web upload, one-click capture from the live store, batch ingestion
Isolate the fabric: remove the background, cluster the dominant colors
Compare with the swatch in a perceptual color space → pass, warning or fail
Flagged only: a vision model explains the defect, with the measurements in hand
Correction targets computed from the pixels, in three intensities
A designer compares, chooses and downloads, or rejects

04

Where the innovation is

01

The math decides, the AI explains

Color difference is measured with ΔE2000 in the CIELAB color space, the perceptual standard used across the color industry: reproducible, explainable and free to run. The vision model is asked for a diagnosis in an editor’s words. If it also suggests numbers, they are discarded and replaced with values computed from the image itself.

02

Measure the fabric, not the photo

Background and highlights are masked out, the remaining pixels are clustered into a handful of dominant colors, and the comparison uses the largest fabric cluster instead of the image average, so shadows and accent pillows do not decide the verdict. The plain average is still reported as a second signal.

03

AI only where it pays

The deterministic pass runs on every image at no API cost. The vision model is offered only for warnings and failures, and it receives the measured difference and both colors alongside the images, so it explains a known, quantified gap instead of guessing from scratch.

04

Consistency as a second reference

Besides the swatch, a correction can target the shared color of the other photos in the same product series. That matches what the client actually cared about: the same product looking the same across its photos and across screens.

05

A designer stays in charge

Every correction comes in three intensities with the background untouched and a before-and-after view, and a designer chooses. Tolerance thresholds are controls, not constants, because how strict to be is a business decision. If the AI call fails, the tool falls back to the measurement and keeps working.

05

How the work is split

The whole design rests on one decision: let deterministic color science produce every number, and use AI for the part machines were bad at until recently, which is explaining a defect the way a retoucher would.

Who does what

The division of labor inside every analysis.

Math decides

Measurement, verdict and correction values

Measure
ΔE2000, CIELAB
Isolate
Mask + clustering
Verdict
Tunable thresholds
Final call
A designer

AI explains

  • Describes what is wrong, in a retoucher’s words
  • Runs only on flagged images
  • Gets the measurements as context; its numbers are never used

One showcase photo, before and after correction

Color difference against the fabric swatch, ΔE2000. Lower is better: below the tolerance a photo passes.

06

Results

  • A working prototype in about a week, in three forms: a web app, a packaged desktop app and a containerized ingestion service.
  • On a demo product series it caught a photo of a different colorway entirely, a brown sectional filed under a navy fabric.
  • A showcase photo went from a clear fail to a clear pass after a designer-approved correction.
  • AI cost estimated at around ten cents per thousand images, because only flagged images reach the model.
  • The client’s creative and imaging leadership confirmed the need, and the conversation moved to a test on real product series.
  • It is a prototype: it has not been run against the full library, and tolerances still need calibrating per color family and per type of image.

Estimated AI cost per 1,000 images

Estimate from vision-model list prices, not measured. The deterministic pass runs on every image at no API cost.

Every image sent to the model≈ $1.10
Half of the images flagged≈ $0.54
One in ten flagged≈ $0.11

07

What we learned along the way

Outliers poison the consensus

The photo of the wrong colorway pulled the series average toward itself, and the strongest correction would have repainted a brown sofa navy. Outliers have to be excluded from the reference, and a photo of a different product should be flagged, never corrected. That is why a person makes the final call.

Tolerance is a business decision

Whites, creams and grays drift more than saturated colors, and 3D renders and photography render the same fabric differently. One global threshold would fail most of the library, so tolerance has to be set per color family and per image type.

Never block on the AI

Model calls time out and responses sometimes come back malformed. When that happens the tool falls back to its own measurement and keeps going, so an audit never stops because a model did.

Stack

  • TypeScript
  • Next.js
  • React
  • Tailwind CSS
  • sharp
  • colorjs.io (CIELAB, ΔE2000)
  • Vercel AI SDK
  • Gemini vision
  • Electron
  • Python
  • FastAPI
  • Playwright
  • Server-Sent Events
  • Docker

Is quality control eating your team’s time?

We combine deterministic measurement with AI where it adds judgment, so your team reviews only what really needs a human eye.

Book a discovery session

Retailer, products and images are withheld under confidentiality agreements. Measurements come from a demo set; no client imagery is shown. Cost figures are estimates. Delivered as the specialist technology partner of a production and development agency, which held the direct client relationship.