Skip to content

bug(figures): a page-sized photograph is indistinguishable from a page-sized raster chart #511

Description

@r-uben

Split from #167 (cubic P2 on PR #510). #167's acceptance asks that "logos/photos/signatures/decorative
rasters stay native prose or ordinary figures". The placement-area gate in #510 closes the small
half of that — logos, signatures, header marks, small decorations. It does not close the large half,
and this issue is the honest remainder rather than an overclaim in #510.

What is left

Once a raster's placed area clears CHART_MIN_CLUSTER_AREA, has_chart_marks returns True. So a
half-page photograph, a full-bleed decorative background, a portrait, or a scanned letterhead still
routes its page into the chart-asset lane, where the page's prose ships as an untranscribed image.

Why the gate cannot be tightened further

Geometry is exhausted. A page-sized photo and a page-sized raster chart have the same placement, the
same aspect ratios, and the same relationship to the surrounding text. get_images() exposes
dimensions, colourspace and bit depth; none of those separate a scatter plot from a photograph — a
screenshot of a chart is a photograph by every one of them.

Raising the area bar does not help either: it would trade these false positives for false negatives on
real full-page charts, which is the worse error (a chart wrongly kept as native ships as word-salad
tick labels — #249).

What would actually decide it

Something that reads the image, not its box. Candidates, none free:

  • colour/edge statistics — a chart is mostly flat regions and axis-aligned strokes on a light
    ground; a photograph has broad continuous-tone histograms. Deterministic and cheap, but a
    heuristic with a threshold that must be measured on the corpus, not guessed (repo rule: no magic
    thresholds).
  • the VLM already in the pipeline — accurate, but it is a paid/GPU call on every born-digital
    page carrying any large image, which is the cost the chart lane exists to avoid.
  • caption/context text — "Figure N:" near the image. Weak on its own, useful as a tiebreak.

Doing this properly starts with a measurement, not an implementation: how often does a large
non-chart raster actually appear on a born-digital page in the corpus? If the answer is "rarely",
the current fail-toward-chart behaviour is the right trade and this closes as WONTFIX with that
number recorded.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions