Skip to content

Explainer: Text Detection API - #113

Merged
reillyeon merged 5 commits into
WICG:mainfrom
alvinjiooo:text-detection-explainer
Sep 12, 2026
Merged

reillyeon merged 5 commits into
WICG:mainfrom
alvinjiooo:text-detection-explainer

Conversation

@alvinjiooo

Copy link
Copy Markdown
Contributor

Summary

We have put together an explainer dedicated to the Text Detection API, focusing on the motivation, benefits for web developers, and the modern asynchronous API design.

The full explainer can be found here:
https://github.com/alvinjiooo/shape-detection-api/blob/text-detection-explainer/text_detection_explainer.md

Key Topics Covered

  1. Motivation & Tradeoffs Today:

    • Comparison with client-side WebAssembly/JS OCR bundles (multi-megabyte download overhead, CPU/battery strain, lack of hardware acceleration).
    • Comparison with remote cloud vision services (network latency, recurring costs, failure offline, data privacy concerns).
  2. Core API Surface (MVP):

    • Modern asynchronous initialization via static Promise<TextDetector> TextDetector.create() to ensure detector readiness before use and provide predictable error handling.
    • Line-level text detection via detect(ImageBitmapSource image) returning detected text, axis-aligned boundingBox, and oriented cornerPoints quadrilateral vertices.
    • Support across both Window and DedicatedWorker contexts to enable off-main-thread video and camera pipelines.
  3. Future Work & Potential Extensions:

    • Language negotiation and availability checking (TextDetector.availability(options)).
    • Structural hierarchy (blocks, lines, words).

We welcome thoughts, feedback, and discussion from the community and implementers!

@alvinjiooo alvinjiooo left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nondebug and @reillyeon,
PTAL and thanks!
Alvin

Comment thread text_detection_explainer.md
Comment thread text_detection_explainer.md Outdated
@alvinjiooo alvinjiooo changed the title Explainer: Text Detection APIAdd Text Detection API explainer Explainer: Text Detection API Sep 8, 2026
@alvinjiooo
alvinjiooo requested a review from tomayac September 8, 2026 22:06
Comment thread text_detection_explainer.md

@tomayac tomayac left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a number of suggestions, but the general direction LGTM.

I wonder if there should be a way to opt in and out of features for different use cases:

  • Pure OCR might not need the text position.
  • Text blurring might not need the OCR'ed text.

Comment thread text_detection_explainer.md Outdated
Comment thread text_detection_explainer.md Outdated
Comment thread text_detection_explainer.md Outdated
Comment thread text_detection_explainer.md Outdated
Comment thread text_detection_explainer.md
@alvinjiooo

alvinjiooo commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Left a number of suggestions, but the general direction LGTM.

I wonder if there should be a way to opt in and out of features for different use cases:

  • Pure OCR might not need the text position.
  • Text blurring might not need the OCR'ed text.

Regarding opting in/out of boundingBox vs. rawValue, it seems only macOS (Vision.framework) and Tesseract support a bounding-box-only request mode (without running character recognition), whereas other platform OCR APIs (like Windows and Android) always return both together in a single pass.

I think maybe we can keep it in future work of this explainer can explore selective detection modes later when more OCR engines support it.

@alvinjiooo
alvinjiooo requested a review from tomayac September 9, 2026 19:30

@tomayac tomayac left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for having taken all my comments into account :-)

@reillyeon
reillyeon merged commit 7d59ac3 into WICG:main Sep 12, 2026
2 checks passed
github-actions Bot added a commit that referenced this pull request Sep 12, 2026
SHA: 7d59ac3
Reason: push, by reillyeon

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions Bot added a commit that referenced this pull request Sep 12, 2026
SHA: 7d59ac3
Reason: push, by reillyeon

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

3 participants