Skip to content

Edge-aware dot density + Brownian background dots#74

Merged
itamarwe merged 1 commit into
claude/dot-art-highlight-levelsfrom
claude/dot-art-edge-density-bg-motion
Jun 29, 2026
Merged

Edge-aware dot density + Brownian background dots#74
itamarwe merged 1 commit into
claude/dot-art-highlight-levelsfrom
claude/dot-art-edge-density-bg-motion

Conversation

@itamarwe

Copy link
Copy Markdown
Owner

Two enhancements to the profile dot-art, both verified headlessly.

1. Edge-aware density

Density now follows image information, not just brightness:

rho = tone^GAMMA * (FLAT_BASE + EDGE_GAIN * edge)

where edge is a blurred Sobel magnitude. Detailed regions (face, hair, beard, collar) pack in many more dots, while flat regions (the t-shirt) thin out. tone still gates the figure so the dark background stays empty. Result: the face is now the dense focal point and the shirt reads light — a clear before/after render confirmed the shift.

2. Foreground / background split + Brownian background

No transparent PNG exists in the repo, so the foreground mask is derived from the photo itself: the subject is far brighter than the near-black studio backdrop, so a flood fill of dark pixels inward from the image border yields a clean silhouette (verified). If a public/img/profile.png with real alpha is dropped in later, the generator can prefer that.

  • Each emitted point now carries an fg flag — the points file is stride 4 (x, y, b, fg); ProfileDots.tsx reads stride and stays backward-compatible with the old stride-3 format.
  • Background dots (1233 of 8000) drift with a loose Brownian wander (weak tether + random kicks) like floating dust, while the foreground figure animates exactly as before. A bounded-motion test confirmed they wander visibly without flying off.
  • Breathing now pivots on the foreground centroid; cursor repulsion is shared by both populations.

Tunable knobs in research/profile-dots/stipple.mjs (FLAT_BASE, EDGE_GAIN, EDGE_BLUR, BG_THRESH) and components/ProfileDots.tsx (BG_SPRING, BG_BROWN). Regenerated points.json. tsc + lint clean.

Note on base branch

This stacks on claude/dot-art-highlight-levels (PR #73), which itself stacks on claude/profile-dot-art-sampling-uo3vkz (PR #72) — base is set so the diff shows only this change. Happy to consolidate the stack into a single PR if you'd prefer; just say the word.

🤖 Generated with Claude Code


Generated by Claude Code

Density now mixes tone with edges so the dots follow image *information*:
rho = tone^GAMMA * (FLAT_BASE + EDGE_GAIN * edge), where edge is a blurred
Sobel magnitude. The face/hair/beard/collar pack in many more dots while the
flat t-shirt thins out; tone still gates the figure against the empty
background.

Separate foreground from background without a transparent PNG: the subject is
far brighter than the near-black backdrop, so a flood fill of dark pixels from
the image border yields a clean foreground mask. Each emitted point carries an
fg flag (output is now stride 4: x,y,b,fg). ProfileDots reads the flag and
lets the background dots drift with a loose Brownian wander (weak tether +
random kicks) while the figure animates exactly as before. Breathing now
pivots on the foreground centroid, and the cursor repulsion is shared by both.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017TDdCdTJbUkH7ZoWDhj7AV
@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
itamarwe-github-io Ready Ready Preview, Comment Jun 29, 2026 5:11pm

@itamarwe itamarwe merged commit 5021dac into claude/dot-art-highlight-levels Jun 29, 2026
3 checks passed
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