Skip to content

[#78] Line-quality Phase 3: auto-supersample flat low-res illustrations + --hires + flat economy#79

Merged
realproject7 merged 2 commits into
mainfrom
task/lineqa-phase3
Jun 25, 2026
Merged

[#78] Line-quality Phase 3: auto-supersample flat low-res illustrations + --hires + flat economy#79
realproject7 merged 2 commits into
mainfrom
task/lineqa-phase3

Conversation

@realproject7

Copy link
Copy Markdown
Owner

Fixes #78. Version 0.5.1 → 0.6.0. Auto-supersamples the flat low-res illustration class (the native pixel-grid staircase that read as 'lower resolution') for crisp smooth lines, with a same-fill economy + lossless auto-precision to keep it economical, and a --hires force flag. ONLY the flat <1024 class changes (pigeon 235→545p SSIM 0.872→0.892 crisp; logo 31→220p) — every other input byte-identical (23-image harness); textured/gradient/photo/high-res untouched. Cost: ~2× paths/bytes + slower (2 supersampled traces) on that class. Corpus goldens + full suite green, ruff clean, tests added. No competitor names anywhere.

realproject7 and others added 2 commits June 25, 2026 14:42
…ns + --hires + flat economy

The "looks lower-resolution" gap (forensically confirmed) is the native pixel-grid trace:
low-resolution flat cartoons (e.g. a 640px JPEG) staircase because curves are fit on the
native grid. Supersampling the mask (large viewBox kept; never coord-rescale) fixes it.

- pipeline.py: AUTO-supersample the flat low-res illustration class (_supersample_candidate)
  to _SUPERSAMPLE_AUTO_RES=1536; new ConvertOptions.hires / --hires forces it on any color
  input. When supersampling, uncap the region merge (_SUPERSAMPLE_REGION_MAX_PX=20000) so the
  high-res path blow-up is consolidated, and apply a SSIM-gated global same-fill merge.
- postprocess.global_same_fill_merge: hoist same-fill fragments into one compound path per
  fill (lossless flat-region economy; the supersample fragments a clean region into many
  same-fill tiles). SSIM-gated by the caller (textured/overlapping art fails it and keeps the
  un-merged trace). Plus the resolution-aware auto-precision lever in smooth.py (lossless bytes).
- cli.py: --hires flag.

Effect (vs native): pigeon 235->545p, SSIM 0.872->0.892, crisp smooth lines (was staircased);
logo 31->220p, SSIM 0.951->0.972. ONLY the flat <1024 class changes — every other input is
byte-identical (verified on the 23-image harness); gradients/photos/high-res/textured untouched.
Textured stays native unless --hires (where the same-fill economy correctly fails the SSIM gate).
Cost: ~2x paths/bytes and slower (2 supersampled traces) on that class. Full suite + corpus
goldens green; ruff clean; tests for auto/gated supersample + global_same_fill_merge. 0.5.1 -> 0.6.0.

Fixes #78

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…time ~half)

At supersample resolution the sharper black core makes the colour tracer carve MORE
near-black edge tints, so the snap's cleaner-guard rejects it and falls back to the base
trace anyway — the snap_pre render was a full second high-res trace paid for nothing.
Gate snap_black on `not did_supersample`. Output is byte-identical (md5-verified pigeon
545p/162KB, logo 220p/65KB); time pigeon 16.9s->9.4s, logo 8.3s->4.9s. Native inputs still
get the dark-snap (c_15 etc. unchanged).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@realproject7 realproject7 merged commit 040b552 into main Jun 25, 2026
4 checks passed
@realproject7 realproject7 deleted the task/lineqa-phase3 branch June 25, 2026 06:05
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.

Line-quality Phase 3: auto-supersample flat low-res illustrations (crisp lines) + --hires + flat economy

1 participant