Skip to content

feat(detect): Detect cross-hatched (X-pattern) redactions#209

Open
mlissner wants to merge 3 commits into
185-detect-dark-highlight-annotations-20260407from
detect-cross-hatched-redactions-20260407
Open

feat(detect): Detect cross-hatched (X-pattern) redactions#209
mlissner wants to merge 3 commits into
185-detect-dark-highlight-annotations-20260407from
detect-cross-hatched-redactions-20260407

Conversation

@mlissner
Copy link
Copy Markdown
Member

@mlissner mlissner commented Apr 7, 2026

Fixes: #169

Summary

  • Detect cross-hatched redactions by identifying X-hatch drawings directly from PDF structure
  • X-hatch patterns are pairs of diagonal lines sharing the same x-range, tiled across the redacted area
  • The pixmap filter can't catch these because cross-hatching creates two dark colors (e.g., black at 86% + dark gray at 14%), failing the unicolor check
  • Updated test_cross_hatches_are_oktest_cross_hatched_redactions to assert 16 bad redactions detected (was only checking char count)

Test plan

🤖 Generated with Claude Code

mlissner and others added 3 commits April 7, 2026 03:48
Some documents use repeating X patterns drawn over dark rectangles
to redact text. The pixmap filter can't catch these because the
cross-hatching creates two colors (e.g., black + dark gray).

Instead of pixel analysis, detect X-hatch drawings directly from
their PDF structure: pairs of diagonal lines sharing the same
x-range, tiled across the redacted area. Text underneath is
extracted and passed through the standard text filters.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replaces the old test_cross_hatches_are_ok (which only checked char
count at the intersection stage) with test_cross_hatched_redactions
that verifies the full pipeline detects 16 bad redactions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mlissner mlissner marked this pull request as ready for review April 7, 2026 10:50
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