Skip to content

Lifted text comes back at its original size: starter poster sizes words from the font's glyphs - #88

Merged
IsraelWebDev merged 1 commit into
mainfrom
feedback/2026-11-30-starter-text-size
Nov 30, 2026
Merged

IsraelWebDev merged 1 commit into
mainfrom
feedback/2026-11-30-starter-text-size

Conversation

@IsraelWebDev

Copy link
Copy Markdown
Owner

Observation

Creators fixing misspelled lettering in AI images want the corrected words to look like the ones they replace, and the advice this month is to keep the picture and move the words onto a real text layer:

funkbox's image_trace with lift_text + texts does that, but in today's promo its starter poster set all-caps lines at about half their size: the title came out at 0.032 of the canvas height where the original was 0.06. That happened because the size was 0.75 x box height, which assumes the box includes ascenders and descenders. poster fit needed two runs (about 100 previews) to bring the words back to size. The starter also used a white canvas, which left a 1 px light seam at the edges under dark artwork. The promo's reviewer flagged that seam.

What changed

  • funkbox/stills/trace.py: the starter poster sizes each lifted line from the chosen font's real glyphs (_ink_scale / _start_size). It fits the words' ink box to the lifted box, by height and by width, so all-caps words come back at the original's size. A slanted line, or a font that can't be loaded, keeps the old rule of thumb.
  • The starter canvas takes the artwork's main palette colour instead of #ffffff.
  • docs/stills.md: one paragraph on both changes.
  • tests/stills/test_s15_lift_text.py: two new tests. The first checks that all-caps text drawn at 120 px on a 1000 px canvas comes back at 0.12 ± 0.012 on a dark canvas. The second checks the fallback for a missing font.

How it was tested

  • On today's promo picture (NIGTH MARKET, 1080x1920, Rubik:900), the starter sizes went from 0.032 / 0.024 / 0.025 to 0.0596 / 0.044 / 0.0442. The originals are 0.06 / 0.045 / 0.045. poster_compare of the unfitted starter rose from 86.7 to 92.4.
  • FUNK_GL_BACKEND=egl python -m pytest -q: 1592 passed, 26 skipped.

From the 2026-11-30 promo run's product feedback.


Generated by Claude Code

…l glyphs

All-caps lines came back at about half their size (0.75 x the box height assumed
ascenders and descenders), so poster_fit had to recover the size. The starter now
measures the words' ink box in the chosen font and fits it to the lifted box, and the
canvas takes the artwork's main colour instead of white, so no seam shows at the edges.
An unknown font or a slanted line keeps the old rule of thumb.

From the 2026-11-30 promo run's product feedback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019RsXeXe7R2yuktRA3h62ig
@IsraelWebDev
IsraelWebDev merged commit 9e2c5c0 into main Nov 30, 2026
4 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