Inspiration

A box of hair dye shows a promise: a model with light, untouched hair. Your hair has a history. It may be darker, warmer, previously dyed, partly gray or porous. "Ash blonde" on dark or dyed hair often turns out orange, patchy, or not lighter at all, and an opened box can't be returned. Try-on apps make this worse, because they paint the box color on your photo. That is the promise, not the outcome.

What it does

DyeCast forecasts what a box will really do to your hair, then shows it.

  • Your starting point. Describe your hair (no photo needed), or let a selfie and a hairline photo suggest values. You confirm every choice. A lighting check explains when the light would skew the color.
  • Help me choose. Three quick questions rank the colors that fit your starting point, with reasons, cautions and real boxes to look for (209 shades across 16 product lines, each checked on a brand or retailer site).
  • The reality check. Pick a shade code, a box photo (read on your device), a goal color or a product link. DyeCast puts the box's promise next to your likely result: a plain-language verdict, the color gap (ΔE2000), what changes (depth, warmth, evenness), roots versus lengths, how many boxes you need, better routes and a safety-first step-by-step plan.
  • See it on you. YouCam AI Hair Color renders both the box promise and the predicted result on your own photo, with a before/after slider.
  • Private by design. Photos are optional. YouCam only receives a cleaned copy after explicit consent, each task is deleted as soon as its results are delivered, stored selfies are off by default, and local previews are cleared at sign-out.

How we use the YouCam APIs

  • AI Facial Color Tones Analyzer: hair color class (a second opinion on the measured level and tone) and skin color (undertone for "Help me choose").
  • AI Hair Length Detection: suggested length, which sets how many boxes you need.
  • AI Hair Density Detection: density from an optional hairline photo, which also sets the box count.
  • AI Hair Color Virtual Try-On: renders the box promise and the predicted result on your photo (full color, or ombre for roots versus lengths).
  • File and Task APIs: upload a cleaned selfie, then delete each task right after delivery.

YouCam provides the perception (your hair now) and the realistic render (your hair after). The forecast in between comes from DyeCast's own deterministic color-chemistry engine: lift limits, underlying warm pigment, toner balance, and roots versus lengths.

How we built it

Next.js 16 (App Router) and TypeScript on Vercel, Drizzle ORM with Turso (libSQL), and a pure color-science engine (CIELAB and ΔE2000) that runs on the server and in the browser. MediaPipe hair segmentation and Tesseract OCR run on the device. Stored photos use AES-256-GCM envelope encryption, a nonce-based Content Security Policy protects the pages, and YouCam units are reserved atomically against per-user and daily budgets. 276 automated tests cover the engine, privacy and budget rules. Without an API key the whole product still runs in demo mode.

Challenges

  • YouCam's hair class said "Black" for some light-brown portraits. We let the on-device measurement decide the level and use YouCam as a clearly labeled second opinion.
  • Privacy had to be honest, not just convenient: consent before upload, a durable deletion queue with a daily sweep, and wording that says what YouCam can and cannot delete.
  • The demo had to be trademark-free, so the film uses a public-domain portrait and hides retail brand names.

What's next

More brands and countries, a hand-off to a colorist for big changes, and comparing real results with forecasts to keep calibrating the engine.

Built during the hackathon

DyeCast was built from scratch for this hackathon. The first commit in the repository is dated Oct 26, 2026, after the submission period opened on Sep 29.

Built With

Share this project:

Updates

Submission history