Skip to content

Frequency-separation skin smoothing (Smoothing / Texture / Scale, global + per-mask)#1326

Open
SandeepSubba wants to merge 1 commit into
CyberTimon:mainfrom
SandeepSubba:skin-smoothing-retouch
Open

Frequency-separation skin smoothing (Smoothing / Texture / Scale, global + per-mask)#1326
SandeepSubba wants to merge 1 commit into
CyberTimon:mainfrom
SandeepSubba:skin-smoothing-retouch

Conversation

@SandeepSubba

Copy link
Copy Markdown

Description

Adds a beauty-retouch toolset to the Details section — globally and inside mask adjustments, so the intended workflow is: AI-subject/brush mask over skin (subtract eyes/lips), then dial in:

  • Skin Smoothing (0–100) — flattens the tonal-blotch band, with an edge guard that fades the effect where normalized mid-band contrast is high (eyes, brows, lips, hair boundaries keep their acutance)
  • Skin Texture (0–100, neutral 50) — how much pore-scale detail is re-injected: 0 = classic soft-glamour blur, 100 = near-original texture with tone-evening only
  • Smoothing Scale (0–100) — the frequency-separation point: blends the flatten base from the clarity blur (~8px, micro-blotches) toward the structure blur (~40px, large patches like under-eye shadows and redness)

Why not negative clarity?

Negative clarity mixes toward the blurred copy, killing pores and hair along with the blotches — the "plastic skin" look. This is proper frequency separation built on the blur pyramid the shader already binds:

fine  = color − tonal_blur                     (pores, hair — preserved)
base  = mix(clarity_blur, structure_blur, s)   (separation point)
out   = mix(color, base, a·edge_guard) + fine · a · tex

Engineering notes

  • No new blur passes — all bands used (tonal/clarity/structure) were already computed and bound
  • No GPU uniform layout changes — the three fields consume existing pad slots in GlobalAdjustments and MaskAdjustments (WGSL + Rust kept in lockstep)
  • Per-mask accumulation follows the clarity/structure pattern; texture accumulates as deviation-from-neutral so untouched masks contribute nothing
  • Old sidecars unaffected — missing keys parse to neutral values, not zero

Type of Change

  • Bug fix
  • New feature

Testing

  • I have tested these changes locally and confirmed that they work as expected without issues

Verified with scripted A/B renders of portrait raws through the full GPU pipeline: at smoothing 80, texture 50 keeps pores while flattening blotches; texture 100 retains near-original texture density; scale 100 evens large tonal patches with eyes crisp. cargo check and tsc clean on this base.

AI Disclosure

  • This PR is AI-generated but guided by a human

🤖 Generated with Claude Code

Adds a beauty-retouch toolset to the Details section, available both
globally and inside mask adjustments: brush or AI-select skin and dial
in three sliders.

- Skin Smoothing (0-100): flattens the tonal-blotch band. An edge guard
  fades the effect where normalized mid-band contrast is high, so eyes,
  brows, lips and hair boundaries keep their acutance.
- Skin Texture (0-100, neutral 50): how much pore-scale detail is
  re-injected. 0 = classic soft blur, 100 = near-original texture with
  only tone-evening.
- Smoothing Scale (0-100): the frequency separation point - blends the
  flatten base from the clarity blur (8px x scale, micro-blotches)
  toward the structure blur (40px x scale, large patches such as
  under-eye shadows and redness areas).

Unlike negative clarity (a straight mix toward the blurred copy, which
kills pores and hair along with the blotches), this is proper frequency
separation built on the blur pyramid the pipeline already computes:

  fine  = color - tonal_blur                     (pores, hair)
  base  = mix(clarity_blur, structure_blur, s)   (separation point)
  out   = mix(color, base, a) + fine * a * tex   (flatten + re-add)

No new blur passes and no GPU uniform layout changes - the three fields
consume existing pad slots in GlobalAdjustments and MaskAdjustments.
Old sidecars are unaffected: missing keys parse to neutral values.

Verified with A/B renders on portrait raws through the full pipeline at
smoothing 80: texture 50 keeps pores while flattening blotches; scale
100 evens large tonal patches with eyes and texture intact.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants