CLI tool
ad-si/Perspec avatar
ad-si/Perspec

Perspec corrects the perspective of document, whiteboard and receipt photos

Scriptable desktop app to correct the perspective of images

793 stars38 forksCAGPL-3.0

At a glance

What is it?
Perspec is an AGPL licensed desktop app and command line tool that detects the corners of a photographed planar object, rectifies it, and can export the result as colour, grayscale, black and white, or a searchable PDF.
Who is it for?
Adopt Perspec if you photograph documents, receipts, whiteboards or facades and want straight, rectified output with an OCR text layer instead of skewed photos. Do not adopt it if you need OCR in languages beyond English, German and Spanish, since the text layer is limited to Latin characters, or if you need fully unattended batch rectification of badly skewed captures, since corner detection is a computer vision step whose result you may have to correct by hand.
Can I use it commercially?
Yes, with strict conditions. AGPL-3.0 is a network copyleft licence: if people use a modified version over a network, for example as a hosted service, you must offer them its source code under the same licence.
Is it still maintained?
Yes. The repository last received commits 3 days ago.
What is it written in?
Mainly C, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.

Editorial analysis

Keystone correction for things that are meant to be flat

A camera held above a desk does not produce a rectangle, it produces a quadrilateral, and every downstream use of that photo inherits the skew. Perspec exists to remove that distortion. It is an app and workflow to perspectively correct images, with whiteboards, document scans and facades given as the example cases, and the README adds receipts to the list of things it suits. That list is the real scope of the tool: Perspec is for planar objects, so a page on a table, a whiteboard on a wall or the flat face of a building. It is not a general purpose editor and it is not a document understanding system. The audience is people who digitise paper: archivists, researchers, small offices and anyone who has looked at a phone photo of a receipt and wished it were a scan. The project is AGPL-3.0 licensed and is developed by ad-si, with a commercial download page at feram.gumroad.com for the packaged app and open source code in the repository.

Corner detection first, with manual override when it guesses wrong

The workflow is built around the four corners of the object. You select files with the Select Files button or drag and drop them onto the window, and the integrated computer vision algorithms automatically detect the corners of the document and mark them with circles, which the README illustrates as a diagram with red, green, magenta and blue circles at the four corners of the document rectangle. If the corners are not detected correctly, you can manually drag the circles or the edges to the correct position. That fallback is the part that makes the tool usable in practice, because automatic detection is exactly the step that fails on a low contrast page against a cluttered table, and a rectification that uses the wrong corners produces a plausible but wrong result. Saving is either a button press or the Enter key, the output lands in the same directory as the original photo with -fixed appended to the filename, and if you selected multiple photos they are opened one after another so the whole stack can be worked through in sequence.

Five save modes, from colour to a searchable PDF

The save buttons are really an output format selector, and the choices reflect different downstream needs. Save writes the image in 24-bit color. Save Gray writes 8-bit grayscale and normalizes the range of values. Save BW writes true 1-bit black and white, where each pixel is either black or white. Save BW Smooth writes mostly black and white with some grayscale edge smoothing, and the README recommends this option for documents, receipts and whiteboards, which makes sense because hard thresholding destroys thin strokes in handwriting. Save PDF writes the image in 24-bit color as a searchable PDF, where the text is recognized with Tesseract and added as an invisible layer so it can be searched, selected and copied. The OCR limitation is explicit: English, German and Spanish are supported, and the text layer is limited to Latin characters. The repository ships a tessdata directory and a tesseract-bundled directory, so the OCR engine and its language data travel with the application rather than being a system dependency you have to arrange.

A CLI for batch correction, and a rename sub-command

Every part of the app has a command line counterpart, which is what makes Perspec usable in a batch pipeline. The documented invocation points at the bundled script inside the application bundle:

sh
/Applications/Perspec.app/Contents/Resources/perspec fix path/to/image.jpeg

You can also pass several images and they will all be opened one after another, which the README describes as very useful for batch correcting a large set of images. The sub-command is fix, and there is also a rename sub-command used in the photo digitisation workflow to fix the order and names of scanned files. The interface can be launched directly with a gui sub-command, which is the same window described earlier. So the architecture is a GUI for the interactive decisions, a script that does the work, and a CLI that calls the script, with the GUI existing mainly to let a human fix corners before the export.

Prebuilt builds, a Homebrew cask, and a Haskell source build

Installation comes in three shapes. Prebuilt current and previous versions are on the releases page, and the nightly build is published through the project's GitHub actions, where the README warns that you must fix the file permissions after download:

sh
chmod +x \
  ./Perspec.app/Contents/MacOS/Perspec \
  ./Perspec.app/Contents/Resources/{perspec,script}

On macOS there is also a Homebrew tap:

sh
brew install --cask ad-si/tap/perspec

Building from source is done with Haskell's stack, and Platypus with command line tools enabled is required to build from source:

sh
git clone https://github.com/ad-si/Perspec
cd Perspec
make install

That copies the Perspec.app to your /Applications directory and makes the perspec command available on your path, after which you can drop images on the app window or use it via the CLI. On Linux and NixOS, the Nix Flake provides all necessary dependencies:

sh
nix develop
stack install  # Or: hpack && cabal install

The repository layout backs this up, with a stack.yaml and flake.nix at the root, a package.yaml and Setup.hs for the Haskell build, a makefile, and separate source and app directories.

A digitisation workflow built around the phone camera

The README treats the app as one step in a wider pipeline for turning paper into files. The workflow starts with taking photos, using a camera app that lets you lock rotation, and, more unusually, a sound activated camera so that the shutter can be triggered by clicking your tongue or snipping your finger, with hardware and firmware options such as the Pluto Trigger, Magic Lantern for Canon and the iSoundCam Android app listed. That matters for batch scanning: it removes the need to press the shutter and the camera from the frame for every page. After capture you use the rename sub-command to fix the order and names of the scanned files, then verify that all pages were captured and have the correct filename, that the images are sharp enough, have high contrast and have the correct orientation. For the best image quality, convert the images optionally to a lossless format such as png, apply rotations, and convert them to grayscale, and exclude the covers.

Interface scaling, licence and the limits of the OCR layer

Two practical details close out the evaluation. First, display handling: Perspec scales its interface with the scaling setting of the display it is shown on, so that it has the same physical size everywhere, and if the detected scaling does not match what you want, for example because of a misconfigured Xft.dpi on X11, you can override it with the PERSPEC_UI_SCALE environment variable:

sh
PERSPEC_UI_SCALE=1.5 perspec gui

Second, the constraints. The OCR text layer covers English, German and Spanish and is limited to Latin characters, so a Japanese or Chinese document gets a correctly rectified image but no searchable text. The corner detection is automatic with a manual override, so a fully unattended pipeline over unpredictable captures will sometimes need a human, and the correction itself is a planar homography, which means a curled page or a wrinkled surface is not corrected by this tool. On maintenance, the last push to the repository was on 2026-10-19 and the release tags are recent, v1.0.0.0 on 2026-07-09, v1.1.0.0 on 2026-08-25 and v1.2.0.0 on 2026-09-11, so the project is moving quickly. The licence is AGPL-3.0, which matters if you intend to ship a modified build to a closed set of users.

Editorial conclusion

Adopt Perspec if you photograph documents, receipts, whiteboards or facades and want straight, rectified output with an OCR text layer instead of skewed photos. Do not adopt it if you need OCR in languages beyond English, German and Spanish, since the text layer is limited to Latin characters, or if you need fully unattended batch rectification of badly skewed captures, since corner detection is a computer vision step whose result you may have to correct by hand. Verify first that the detected corners match reality on your own captures, that PERSPEC_UI_SCALE gives a usable interface on your display, and that the AGPL-3.0 licence in the license file fits how you distribute the tool.

Frequently asked questions

How do I install Perspec on macOS?

You can download a prebuilt version from the releases page, install the Homebrew cask with brew install --cask ad-si/tap/perspec, or build from source with git clone, cd Perspec and make install, which requires Haskell stack and Platypus with command line tools enabled.

How do I correct several images at once with Perspec?

You can pass several images to the CLI, for example /Applications/Perspec.app/Contents/Resources/perspec fix path/to/image.jpeg, and they will all be opened one after another, which the README describes as useful for batch correcting a large set of images.

Does Perspec produce searchable PDFs?

Yes. The Save PDF option writes the image in 24-bit color as a searchable PDF, where the text is recognized with Tesseract and added as an invisible layer. English, German and Spanish are supported and the text layer is limited to Latin characters.

What happens when Perspec detects the document corners incorrectly?

You can manually drag the circles or the edges to the correct position before saving, since the corner detection is a computer vision step that can fail on low contrast pages.

Official sources

  1. ad-si/Perspec on GitHub
  2. License: AGPL-3.0
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/ad-si-perspec.svg)](https://hysenlabs.com/projects/ad-si-perspec)

Was this useful?