Skip to content
guptaprakhariitrPublic

About

Caliper — on-screen pixel ruler, loupe & color picker with auto edge-snap. Free & open macOS app.

Resources

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

PicaMac

On-screen pixel ruler, loupe & color picker — with auto edge-snap.

Draw a precise measurement guide over any UI, magnify pixels with a loupe, and read back colors as hex/HSL. PicaMac's differentiator is automatic edge-snap: a real on-device edge detector finds element boundaries so your measurement endpoints lock to the actual edges, not "close enough." 100% local. Free & open source.

A free, native macOS replacement for paid pixel rulers and color pickers.

PicaMac

The images below are generated by PicaMac itself (swift run CaliperChecks docs/images). To use your own, drop PNGs into docs/images/ and update the links.


What it does

Measurement guide with end-caps + live W × H px badge, snapped to element edges Loupe + color readout — zoomed pixel grid, crosshair, hex/HSL chip

Auto edge-snap (on-device)

PicaMac runs a Sobel gradient edge detector over the captured pixels, accumulates gradient energy per column and per row, and locks your measurement endpoints to the detected element boundaries — entirely on-device, no network. Toggle it off for free-hand measuring.


Capabilities

Area Features
Measure Transparent overlay ruler · pixel-perfect width × height with end-caps + live badge · adjustable endpoints
Edge-snap On-device Sobel edge detection finds element boundaries · endpoints snap to the nearest edge within tolerance · visible snap guides
Loupe Magnifier with zoomed pixel grid + crosshair for sub-pixel placement
Color Color picker with multiple formats — #RRGGBB hex and HSL readout · swatch chip
Capture Live screen capture via ScreenCaptureKit (user-granted Screen Recording) · works on any window or region
Trust 100% local — pixels never leave your Mac · no telemetry in the shipped build

Architecture

PicaMac builds entirely from source. The app is a SwiftUI shell on top of a small set of focused modules.

The app ships as PicaMac (display name + App Store listing). The Swift package, modules, bundle ID (com.plainware.caliper) and the on-disk targets below keep the original Caliper name, so existing identifiers and Firebase config are unchanged.

Sources/Caliper      executable (@main)   — app entry, menus, settings, logging bootstrap
Sources/CaliperUI    library              — overlay/measuring UI + view model
Engines/EdgeEngine   library              — edge detection, snapping, color conversion
Packages/Core        shared modules       — DesignSystem, RemoteConfigKit, LicenseKit, UpdateKit, LogKit, ScreenshotKit

EdgeEngine — public API

struct SnapLines: Sendable { let verticalX: [Int]; let horizontalY: [Int] }

struct EdgeEngine: Sendable {
    func detectSnapLines(in cg: CGImage, threshold: Double = 0.25) -> SnapLines
    func nearestSnap(to value: Int, in candidates: [Int], maxDistance: Int = 12) -> Int?
    func hexString(r: Int, g: Int, b: Int) -> String
    func rgbToHSL(r: Double, g: Double, b: Double) -> (h: Double, s: Double, l: Double)
    static func makeSyntheticImage(...) -> CGImage?
}
  • Feature flags (paid features, in-app updates, force-update) are built but gated OFF via Firebase Remote Config (RemoteConfigKit) and flipped on later with no app update. GoogleService-Info.plist is gitignored, and the app fails open (runs normally with default flags) when it is absent.
  • Logging: every run writes to ~/Library/Containers/com.plainware.caliper/Data/Library/Logs/Plainware/PicaMac.log (sandboxed) — tail -f it to debug.

Build & run

The dev loop needs only the Swift toolchain (Command Line Tools) — no Xcode required.

Build the app bundle and launch it:

Scripts/bundle.sh --package-dir . --product Caliper --name Caliper \
  --bundle-id com.plainware.caliper --info-plist Resources/Info.plist \
  --entitlements Resources/Caliper.entitlements --icon Resources/AppIcon.icns --open

Or build the package directly:

swift build

To work in Xcode, generate the project with XcodeGen and open it:

xcodegen generate
open Caliper.xcodeproj

Run the test suite + regenerate the gallery / App Store screenshots (off-screen, no permissions):

swift run CaliperChecks ./screenshots

License

Licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) — see LICENSE. © 2026 Prakhar Gupta.

About

Caliper — on-screen pixel ruler, loupe & color picker with auto edge-snap. Free & open macOS app.

Resources

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages