Skip to content

Crisp density-rendered text (block/small/shadow)#35

Open
irobinson010 wants to merge 2 commits into
mainfrom
feature/caption-text-accuracy
Open

Crisp density-rendered text (block/small/shadow)#35
irobinson010 wants to merge 2 commits into
mainfrom
feature/caption-text-accuracy

Conversation

@irobinson010

Copy link
Copy Markdown
Owner

Summary

The density text styles were soft/fuzzy ('ever so slightly off', and outright unreadable at some widths). Three compounding causes, all in text_to_ascii_art:

  1. Fixed 24px render — wide targets upscaled a small image (pure blur). Now one measured re-render sizes the font so each output cell averages ~8×8 source pixels, at every width.
  2. Bicubic resampling — rings at stroke edges. Now BOX (true area-average coverage).
  3. No contrast shaping — anti-aliased edges mapped straight to ramp characters, putting a halo of :=-. around every stroke. Now an S-curve collapses the halos while keeping genuine midtones.

Before/after at width 60, I see you block style: unreadable mid-ramp scatter → solid legible strokes. At width 90 the improvement is dramatic (smooth curves, filled strokes). Captions inherit everything via caption_lines.

Test plan

  • 209 tests pass — two new regressions: wide targets fill the requested width (adaptive sizing), and halo-character ratio stays low (S-curve)
  • CI matrix green

🤖 Generated with Claude Code

… S-curve

The block/small/shadow styles rendered text at a FIXED 24px font and
resized that to the target grid with default bicubic: wide targets
upscaled a small blurry render, bicubic rang at edges, and anti-aliased
strokes mapped through the ramp as a halo of light characters — 'I see
you' at width 60 was unreadable scatter.

Now: one measured re-render sizes the font so each output cell averages
~8x8 source pixels; BOX resampling gives true per-cell coverage; and a
contrast S-curve (0.18..0.82 stretched to 0..1) collapses edge halos
while keeping genuine midtones. Captions inherit all of it via
caption_lines.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@irobinson010
irobinson010 requested a review from krakenhavoc July 11, 2026 02:30
- Caption positions grow beyond top/bottom: left/right run the text
  rotated 90 degrees along the side (book-spine style, sized against the
  art height); the four corners are sugar for top/bottom with forced
  alignment; 'wrap' flows the text clockwise as a 1-char marquee frame
  around the whole piece. Works in colorized ANSI, HTML, and the plain
  path; image-sampled caption colors use the adjacent side strip.
  Animated/video sinks stack caption rows, so side/wrap fall back to
  bottom there with a warning.
- Centered captions expand out of their middle while dragging - each
  pixel adds width both directions so the text stays visible under the
  cursor - instead of only growing rightward.
- Resize rings step aside for side/wrap layouts (the measured block
  changes in both axes); the number knobs still apply.

Co-Authored-By: Claude Fable 5 <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.

1 participant