Skip to content

Quickstart

One image, or many in a single warm process — a single Reader is reused across every image passed to sceptre run:

Terminal window
sceptre run receipt.png --lang english --format json
sceptre run page1.png page2.png page3.png # batch: models load once
sceptre run sign.jpg --lang english --lang korean # multi-language
sceptre run page.png --lang english --timings # per-stage load/detect/recognize breakdown
sceptre run huge-scan.png --canvas-size 1600 # trade some accuracy for lower peak memory

--format accepts text (the default, tab-separated) or json. --no-detail emits only the recognized text, omitting confidence and box detail. See the full CLI reference for every flag and subcommand.

Decodes PNG, JPEG, BMP, GIF, TIFF, WebP, and NetPBM — all pure-Rust decoders. See Image formats for what’s out of scope.

use sceptre::{Reader, ReadOptions};
let reader = Reader::builder().build()?;
for line in reader.readtext("receipt.png".as_ref(), &ReadOptions::default())?.lines {
println!("{} ({:.2})", line.text, line.confidence);
}
# Ok::<(), sceptre::OcrError>(())

This requires a backend feature and download enabled in Cargo.toml — see Installation. Full walkthrough in the Library guide.

Terminal window
sceptre mcp --lang english

Starts the stdio MCP server (requires the CLI’s mcp feature) with a readtext tool that runs OCR over an image file and returns recognized lines with their bounding boxes and confidences. See the MCP server guide for the tool schema and an example invocation.