A plan for iterating on bubble detection/enlargement against a diverse corpus (western comics, manga, negative bubbles, SFX-heavy, painted). Written to be executed in a later session. Nothing here is built yet.
The emulator is a poor iteration harness: SAF folder picking, flaky taps, a HUD
that auto-hides, multi-display screencap, ~10-15 s per page. Use it only for
the final on-device spot-check (render quality, perf, archive decoding).
SpeechBubbleVisualizer already runs the exact production domain code
(SpeechBubbles.detect + BubbleLayout.enlarge) and writes -bubbles.png
(detection) and -enlarged.png (what the reader sees) per page, headless,
~150 ms/page, deterministic.
It is a high-fidelity proxy, not pixel-identical to the device, because the
inputs differ (the algorithm and the ANALYSIS_WIDTH = 1000 pool formula
are identical in PanelDetector and the visualizer):
decodeSampled(bytes, 2160)
(power-of-2 subsample, only when native width > 2160), then pools. The
visualizer reads the native JPEG. For pages =< 2160 px wide (e.g. Venomverse
at 1440) both decode at the same width and the same pool, so detection
matches; for larger scans the pool can differ.contentCropped() before detection; the
visualizer does not. This shifts coordinates and the border-touch logic.BitmapFactory) nudge threshold-border
pixels.Make it faithful first (~15 lines in SpeechBubbleVisualizer): subsample
the source toward 2160 the same way decodeSampled does, and apply the same
margin crop before detect. After that the -enlarged.png is what the device
produces (modulo the render engine, which is geometrically equivalent). This is
the prerequisite for trusting the offline loop.
Without a regression gate, LLM-driven threshold tuning overfits and reintroduces the hard-won cloud/moon/SFX false-positive rejections. Per page, per comic:
speech-bubbles.md).Ground truth is agent-labeled once per page and stored beside the corpus, so every algorithm change is scored against the same labels and regressions are caught immediately.
8-12 issues spanning: western white/cream bubbles; manga B&W (tall/narrow bubbles, borderless bubbles, screentone, furigana, right-to-left); painted / watercolor; SFX-heavy pages; and negative/black bubbles. Manga will hurt the most.
-bubbles.png / -enlarged.png.-enlarged.png into structured findings
{bubbles_grown, bubbles_missed, spurious_art_enlarged, clipped_or_covering}.Fits a multi-agent workflow (fan out over pages -> judge per image -> aggregate), which must be opted into explicitly and is token-heavy. A single serial run over one comic is fine without a workflow.
For the top-N worst or best pages, push to the Fold/emulator, toggle enlarge,
screenshot, confirm render + perf. Emulator serial emulator-5556
(Pixel_10_Pro_Fold) or a physical Fold.