Inspiration
I ran one face through the YouCam Skin Analysis API, then ran it again with a blur of two pixels and nothing else. The texture score rose from 61 to 92 and the pore score from 41 to 55. Adding warm light and 20% more brightness took pores to 69. The skin was identical.
That experiment is a before and after ad. The after photo is softer, brighter and warmer, and together those three things raise skin scores with no change to the skin. Right before you pay, that photo is the evidence you are asked to trust.
So I turned the test around: remove the camera differences, measure again, and whatever disappears was never skin.
What it does
Paste a before and after ad. One screenshot with both faces is enough. SameLight finds both faces in your browser, brings them to the same focus, exposure and colour, and measures the skin twice with YouCam Skin Analysis: once as published, once under the same light. Then it shows:
- How much of the promise is left. In the first example, the ad shows +94 points and +3 are left under the same light.
- A plain verdict. "Mostly the camera", "Part camera, part skin" or "Not explained by the camera". A pair with almost no change reads "No clear claim to test".
- What the camera changed. Such as "After photo is 2.0× softer" and "After photo is 19% brighter".
- What to do before you pay. Steps that change with the verdict.
- Whether you need it at all. Choose a selfie, and SameLight compares your skin with where the product really takes the skin in the ad.
Three checked examples open without any upload, so you can try it in one click at https://samelight.pages.dev.
How I built it
- Line up. MediaPipe Face Landmarker runs in the browser, finds both faces, then levels and scales them. Each face is framed to fill 70% of the image width, above the 60% Skin Analysis requires.
- Match exposure and colour. Eyes and brows do not brighten with skincare, so the ratio between them in the two photos gives the camera's gain for each colour channel.
- Match focus. Eyes, brows and lip edges keep their detail whatever the skin does, so any loss of detail there is the camera. The sharper photo is softened with a Gaussian blur until two frequency bands match at those parts.
- Match lost highlights. Detail blown out in the brighter photo cannot come back, so the same ceiling is applied to the other photo.
- Measure twice. A change counts only if it holds in both the published pair and the same-light pair.
The page is plain HTML, CSS and JavaScript on Cloudflare Pages. Pages Functions keep the API key on the server.
YouCam APIs used
- Skin Analysis is the core measurement. Each check scores four photos, and the selfie check scores one more.
- Skin Simulation changes the skin while the camera stays the same, which tests that SameLight keeps genuine results.
- Text to Image creates the example and test faces, so no real customer appears in the app or the video.
Challenges I ran into
- Order mattered. A brightened photo has inflated contrast and reads as sharper than it is. Measuring focus first underestimated the blur, so exposure now comes first.
- Small screenshots. Skin Analysis needs a large face, and faces in a screenshot are small. Framing each face after alignment means a screenshot about 1,000 pixels wide works.
- Choosing a reference for light. The background looked like the obvious choice, but a white or overexposed wall gave bad readings. Eyes and brows gave steady ones: on pairs brightened by a known 20%, they measured between 18.6% and 20.4%.
Accomplishments I'm proud of
I tested SameLight with known answers before launch.
| Test | Pairs | Ad shows | Left under the same light |
|---|---|---|---|
| Camera tricks, no skin change | 3 | +88 pts | +2 pts (3%) |
| Real skin change, made with YouCam Skin Simulation | 3 | +161 pts | +145 pts (90%) |
| Real change plus camera tricks | 1 | +214 pts | +88 pts (41%) |
| Same photo, copied | 2 | +2 pts | +1 pt |
The browser code that produced these numbers is the code the app runs, and the raw scores are in the repo.
What I learned
A skin score responds to the photo as well as the skin. Two scores can only be compared when the two photos were taken the same way, and that can be arranged after the fact.
What's next for SameLight
- A browser extension that runs the check beside the buy button.
- A same-light badge that brands can earn by publishing pairs that pass.
- A wider test on published ads.
Links
- Live app: https://samelight.pages.dev
- Code: https://github.com/0Smallcat0/samelight
Built With
- cloudflare-pages
- css3
- html5
- javascript
- mediapipe
- youcam-api