# Lighting Normalize

> Normalize lighting and color between before/after photos for fair aesthetic comparison. Use when photos have different lighting, 光线不一样, unfair comparison, or preprocessing patient photos before post-op simulation.

- Skill: `freakyglorian-create/lighting-normalize` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add freakyglorian-create/lighting-normalize`
- Raw SKILL.md: https://api.skillmd.com/api/skills/freakyglorian-create/lighting-normalize/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: freakyglorian-create (https://skillmd.com/u/freakyglorian-create)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/freakyglorian-create/lighting-normalize

---


# Lighting Normalize

Eliminate **「只是光线变了」** skepticism before any simulation or comparison.

## When to Apply

- Clinic phone photos vs ring-light after (hypothetical)
- Different sessions, windows, flash
- Before/after slider UI where fairness is critical

## Methods (pick one)

| Method | Speed | Best for |
|--------|-------|----------|
| Histogram matching | Fast | Same scene, different exposure |
| Retinex (SSR/MSR) | Medium | Uneven shadow on face |
| Reference color transfer (Reinhard) | Medium | Different color temperature |
| CLAHE on L channel (Lab) | Fast | Local contrast normalization |

## Workflow

```bash
python scripts/normalize_lighting.py before.jpg after.jpg --output after_normalized.jpg --method reinhard
```

For single-image prep before simulation:
```bash
python scripts/normalize_lighting.py patient.jpg --reference clinic_standard.jpg --output patient_norm.jpg
```

## Standard Reference

Maintain a `clinic_reference.jpg` (neutral frontal, D65 lighting) in project assets.  
All patient photos normalized toward this reference before entering sim pipeline.

## Guardrails

- Don't normalize so aggressively that skin pathology signals disappear
- Keep original + normalized pair for medical records
- Document: `lighting_normalized: true` in output manifest

## Integration

Run **before**:
- facial-proportion-analysis (fair measurements)
- before-after-morph (fair morph)
- aesthetic-postop-sim (consistent input)

