Edge-aware dot density + Brownian background dots#74
Merged
itamarwe merged 1 commit intoJun 29, 2026
Merged
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two enhancements to the profile dot-art, both verified headlessly.
1. Edge-aware density
Density now follows image information, not just brightness:
where
edgeis a blurred Sobel magnitude. Detailed regions (face, hair, beard, collar) pack in many more dots, while flat regions (the t-shirt) thin out.tonestill 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.pngwith real alpha is dropped in later, the generator can prefer that.fgflag — the points file is stride 4 (x, y, b, fg);ProfileDots.tsxreadsstrideand stays backward-compatible with the old stride-3 format.Tunable knobs in
research/profile-dots/stipple.mjs(FLAT_BASE,EDGE_GAIN,EDGE_BLUR,BG_THRESH) andcomponents/ProfileDots.tsx(BG_SPRING,BG_BROWN). Regeneratedpoints.json.tsc+ lint clean.Note on base branch
This stacks on
claude/dot-art-highlight-levels(PR #73), which itself stacks onclaude/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