Computer vision CLI & library powered by native OS APIs.
Built in Zig, wrapping macOS Vision framework and Windows WinRT APIs. Produces a standalone CLI binary and a C-compatible shared library for FFI integration.
brew install georgemandis/tap/loupescoop bucket add georgemandis https://github.com/georgemandis/scoop-bucket
scoop install loupeRequires Zig 0.16+.
git clone https://github.com/georgemandis/loupe.git
cd loupe
zig buildBinary: zig-out/bin/loupe
Library: zig-out/lib/libloupe.dylib / zig-out/bin/loupe.dll
loupe faces photo.jpg # detect faces
loupe faces -o face.png photo.jpg # extract each face to a file
loupe faces --blur -o blurred.jpg photo.jpg # blur faces
loupe faces --redact -o redacted.png photo.jpg # black-box facesloupe ocr screenshot.png
loupe ocr --json screenshot.png
loupe ocr --literal code-screenshot.png # no dictionary correction: for code, ids, serials
loupe ocr --words screenshot.png # one line per word, with its box (macOS)loupe barcode image.png
loupe qr image.png # QR codes onlyDetect ArUco fiducial markers (all standard OpenCV dictionaries, auto-detected).
loupe aruco photo.jpg
loupe aruco --dict 4X4_50 photo.jpg # restrict to one dictionary
loupe aruco --json photo.jpgCandidate squares are found natively by the Vision framework's rectangle detector and decoded in pure Zig — no OpenCV dependency. Trade-off: very small markers (under ~1% of image area) or extreme viewing angles may be missed compared to OpenCV's detector.
--dict <name> restricts detection to one dictionary and applies that
dictionary's own error-correction budget — which is 0 for the 4X4 families,
so --dict 4X4_50 requires an exact bit match. Auto-detection (no --dict)
tolerates up to one flipped bit across all families.
Classify image content using 1,300+ scene and object labels.
loupe classify photo.jpg
loupe classify --json photo.jpgDetect detailed facial feature points (eyes, nose, mouth, eyebrows, jawline).
loupe landmarks photo.jpg
loupe landmarks --json photo.jpgDetect skeletal joint positions for humans and hands.
loupe body photo.jpg
loupe hands photo.jpgloupe animals photo.jpgloupe rectangles photo.jpg # detect rectangular shapes
loupe horizon photo.jpg # measure image tilt
loupe saliency photo.jpg # find visually salient regions
loupe saliency --objects img.jpg # objectness-based saliency
loupe score photo.jpg # aesthetic quality score (macOS 15+)
loupe segment photo.jpg # person segmentation mask
loupe segment -o mask.png photo.jpg # save mask as grayscale PNG
loupe cutout -o subject.png photo.jpg # remove the background (macOS 14+)All commands support --json for machine-readable output.
| macOS | Windows | |
|---|---|---|
| Face detection | Yes | Yes |
| OCR | Yes | Yes |
| Barcode/QR | Yes | - |
| ArUco markers | Yes | - |
Face extraction (-o) |
Yes | - |
| Blur/redact | Yes | - |
| Classification | Yes | - |
| Facial landmarks | Yes | - |
| Body pose | Yes | - |
| Hand pose | Yes | - |
| Animal detection | Yes | - |
| Rectangles | Yes | - |
| Horizon | Yes | - |
| Saliency | Yes | - |
| Aesthetic score | Yes (15+) | - |
| Person segmentation | Yes | - |
| Background removal | Yes (14+) | - |
The macOS build uses the Vision framework. The Windows build uses WinRT (face detection and OCR). Commands not available on your platform are hidden from --help.
# Fish
loupe completions fish | source
# Persist: loupe completions fish > ~/.config/fish/completions/loupe.fish
# Bash
eval "$(loupe completions bash)"
# Zsh
loupe completions zsh | source /dev/stdinInstalled automatically via Homebrew.
loupe exports a C-compatible API for use from any language with FFI support. See src/c_api.zig for the full API surface.
void* handle = loupe_load_image("photo.jpg");
LoupeFaceResult* faces;
uint32_t count;
loupe_detect_faces(handle, &faces, &count);
loupe_free(faces);
loupe_free_image(handle);MIT — see LICENSE.
Created by George Mandis