Case studies

Clipcutter: local computer vision to batch-crop photos and videos

Clipcutter is a local tool with two modules: one detects, deskews and batch-crops photos scanned together on A4 pages; the other cuts several ranges out of a video with FFmpeg. Everything runs on the user's machine — no file leaves the computer.

Client
Gomes Code product
Sector
Applied AI · computer vision
Open source soon

Client and context

Scanning family albums or archives yields PDFs with several crooked photos per page, and separating each one by hand takes hours. Cutting video clips usually takes heavy editors or online services.

The problem

“I have dozens of pages with several photos each and I want every photo separate, straight and the same size — without uploading anything.”

Constraints

  • Nothing can leave the machine.
  • No Electron and no front-end build step.
  • FFmpeg errors must show as they are, not as a generic message.

Decisions and trade-offs

  1. Browser UI + local server (FastAPI)

    Why: Uses the browser people already have, without the weight of an Electron app; the only traffic is between the tab and localhost.

  2. OpenCV detection tunable on screen

    Why: Pages rendered at 300 DPI; minimum size, blur and separation are UI controls, and detection reruns automatically.

  3. Two video cut modes

    Why: Fast cut (stream copy, near-instant) or precise cut (re-encode, frame-accurate), with the trade-off explained on screen.

What we built

  • Photo extractor: detection, deskew, crop, resize and ZIP export.
  • Manual correction: delete false positives and draw regions the detector missed.
  • Video cutter: multiple ranges on the timeline, export with per-clip progress.
  • Automated tests for both services.

Results

  • 300 DPIpage rendering before detectionSource: Project README
  • 0files sent off the machineSource: Project architecture

This case's tile

Non-blank lines of code in each project layer.

Clipcutter lines of code by layer
Clipcutter lines of code by layerlines
Interface (JS, CSS, HTML)1,329
HTTP routes394
Services (vision and video)303
Tests151
Data models82

Source: Clipcutter repository · 2026-10-13

Technologies

  • Python
  • FastAPI
  • OpenCV
  • PyMuPDF
  • FFmpeg
  • JavaScript

Want something at this level?

Send the problem, not a spec.