How I Built a 10,225-Color Paint Matcher & AI Visualizer Using CIEDE2000 and Next.js
DEV Community

How I Built a 10,225-Color Paint Matcher & AI Visualizer Using CIEDE2000 and Next.js

If you have ever tried picking a paint color for your house exterior or kitchen cabinets, you know the pain: a shade that looks soft gray on a 2-inch paper chip turns icy blue on a north-facing wall, and a warm white turns yellow under evening lamps.

Most generic AI room redesign apps make this worse - they hallucinate new windows, swap out your kitchen countertops, and invent random colors that don't exist at Sherwin-Williams or Home Depot.

So I built PaintColorAI to solve two specific engineering problems:

  • Accurate cross-brand color math across 10,225 real paint colors (Sherwin-Williams, Benjamin Moore, Behr, and Farrow & Ball).
  • Photorealistic repainting that preserves 100% of your home's architecture, white window trim, brick, countertops, and lighting.

Here is a quick breakdown of what worked (and what didn't).

Why Simple RGB Distance Fails for Paint Matching

Early on, I tried matching a luxury shade like Farrow & Ball Hague Blue or Pigeon to Behr or Sherwin-Williams using Euclidean RGB distance. The results looked awful - two colors with a small RGB distance often had completely different undertones (e.g., green-gray vs. purple-gray).

Switching to CIE LRV (Light Reflectance Value) and CIEDE2000 (ΔE 2000) in CIELAB color space fixed it immediately:

  • ΔE < 2.0 : Virtually indistinguishable to the human eye
  • ΔE 2.0-4.0 : Very close cross-brand equivalent
  • CIE LRV (0-100) : Tells homeowners how much daylight a paint reflects (crucial for dark rooms vs. bright sunny exteriors)

Using this math, I built three free client-side tools that run instantaneously in the browser with zero login:

  • Compare Any 2 Paint Colors - side-by-side swatches, exact ΔE 2000 color difference, and LRV gap across 10,225 real shades
  • Farrow & Ball Dupes Finder - find close Sherwin-Williams, Benjamin Moore, and Behr matches for heritage British hues
  • Behr to Sherwin-Williams Cross-Brand Matcher - bidirectional formula lookup for Home Depot and SW buyers

Why Single-Model AI Repainting Wasn't Enough

When testing real homeowner photos, I noticed two recurring failure modes in image-to-image models:

  • Some models are too conservative on gray-to-gray exterior siding changes or forget to paint one wall in a bedroom.
  • Others accidentally tint crisp white window trim, fascia boards, or stainless steel appliances.

The solution was per-surface routing + strict architectural preservation prompts:

  • Routing large-surface repaints (Exterior Siding, Interior Walls with an optional All Room Walls vs. Accent Wall toggle, and Kitchen Cabinets) to high-compliance editing while locking the input aspect ratio so the Before/After slider stays pixel-aligned.
  • Running a sub-5ms pixel-diff sanity check on the server - if the model ever returns an unchanged image, it automatically retries before the user ever sees it.

Try It Free (No Account Required)

If you are planning a repaint - or just curious how your kitchen cabinets or exterior siding would look in SW 9130 Evergreen Fog, SW 7048 Urbane Bronze, or BM HC-154 Hale Navy - you can test 1 photo completely free without signing up at paintcolorai.com.

Feedback on the color-matching accuracy or UI is always welcome!

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.