Photoshot Retouch Part 6 — Mattifier for local skin shine
Checkpoint: photoshot-retouch-06-mattifier-2026-12-01

Open Windows PowerShell x64 in the extracted lab folder.

  py -3.10 -m venv .venv
  .\.venv\Scripts\python.exe -m pip install -r requirements-lock.txt
  .\.venv\Scripts\python.exe finished\reproduce_mattifier.py

Start with start/settings.json and start/uniform_baseline.py. The baseline
is this chapter's comparison, with its amount set to match the measured
forehead drop. Before running, predict whether a bright object outside the
skin mask can change and whether the same darkening changes the cheek.

finished/service/ contains the source snapshot. The main run generates
input/shine.png, the skin mask, ROI masks, a gentle shine-free gradient,
and a deliberately misleading bright matte mark. The three strength tests
and the matched baseline use the same crop and encoder. In results/, the
RGB patch and the one-byte-per-pixel mask have a matching manifest. The
16-bit case stores little-endian RGB. mattifier-checks.json records the
observed values and the 16-bit comparison.

Optional actual face and skin segmentation on a public-domain NASA image:
  $env:RETOUCH_MODELS = Join-Path $PWD.Path '.models'
  Push-Location finished
  ..\.venv\Scripts\python.exe -m service.models
  Pop-Location
  .\.venv\Scripts\python.exe finished\reproduce_portrait.py

The two Google model files are verified using pinned SHA-256 in models.py.
The portrait runner stages them under an ASCII Windows TEMP location for
MediaPipe. It writes portrait-checks.json. At strength zero the portrait's
8-bit RGB matches the source and merged mode is empty. Layer mode can have
one residual pixel in its mask after the Lab color round trip. The
synthetic run uses fixed support and needs no model weights.

The astronaut sample depicts Eileen Collins and is credited to NASA in
scikit-image's documentation. Model weights and archived video frames
are outside the ZIP. results/sha256.json records the local snapshot.
https://scikit-image.org/docs/stable/api/skimage.data.html#skimage.data.astronaut
https://ai.google.dev/edge/mediapipe/solutions/vision/face_landmarker
https://ai.google.dev/edge/mediapipe/solutions/vision/image_segmenter

