# Before After Morph

> Create smooth before-to-after morph animations and GIFs for aesthetic medicine consultations. Use when the user wants morph video, 过渡动画, before/after transition, or consultation room visual demos for cosmetic procedures.

- Skill: `freakyglorian-create/before-after-morph` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add freakyglorian-create/before-after-morph`
- Raw SKILL.md: https://api.skillmd.com/api/skills/freakyglorian-create/before-after-morph/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/before-after-morph

---


# Before-After Morph

Produce **smooth morph videos** that sell the emotional impact of a simulated outcome — ideal for iPad 咨询室展示.

## Pipeline

1. **Align** both images via eye-nose anchor similarity transform
2. **Cross-dissolve** 0–100% over 2–3 seconds (simple)
3. **Mesh morph** landmark-interpolated warp (premium)
4. Export MP4 + GIF + WebM

## Alignment (required)

Misaligned morphs look like lighting changes, not structural change.

```python
import cv2
import numpy as np

def align_faces(before, after, src_pts, dst_pts):
    M, _ = cv2.estimateAffinePartial2D(src_pts, dst_pts)
    h, w = before.shape[:2]
    return cv2.warpAffine(after, M, (w, h))
```

Anchor points: left eye center, right eye center, nose tip (stable across warps).

## Morph Types

| Type | When | Quality |
|------|------|---------|
| Dissolve | Quick preview | ⭐⭐ |
| Landmark lerp | Same person, structural change | ⭐⭐⭐⭐ |
| Optical flow | Subtle skin/filler changes | ⭐⭐⭐ |

## Export Specs

- Resolution: match before image, max 1080p for display
- Duration: 2.5s loop (before→after→hold→reverse optional)
- FPS: 30
- Add corner label: `SIMULATION`

## Script

```bash
python scripts/morph_sequence.py before.jpg after.jpg --output morph.mp4 --duration 2.5
python scripts/morph_sequence.py before.jpg after.jpg --output morph.gif --fps 15
```

## Creative Variations

- **Split-screen wipe**: after image wipes left over before
- **Slider export**: generate 10 frames for interactive before/after slider UI
- **Slow reveal**: mask expands from nose region outward (rhinoplasty reveal)

See [examples.md](examples.md) for ffmpeg post-processing (fade, logo overlay).

