>_ DevTrendsen

Language

Home

Languages

Sections

Frontend Backend Mobile DevOps AI / ML GameDev Blockchain Security
Haskell

Perspec How to Fix Perspective in Photos in a Couple of Clicks

655 stars

Sound familiar? You photographed an important document or whiteboard notes, but the image is all distorted — corners are skewed, text is tilted. Manually fixing this in graphic editors is time-consuming and tedious. Perspec solves this problem with one mouse movement.

What Perspec Can Do

This cross-platform application (macOS/Linux) can:

  • Automatically aligns perspective in photos of documents, whiteboards, building facades
  • Lets you manually specify corners for precise correction
  • Supports batch processing via command line
  • Converts images to B/W or grayscale for better readability

How It Works

  1. Open the application
  2. Drag the photo into the window
  3. Mark the four corners of the area you want to align
  4. Press Enter — Perspec does the rest

The interface is so simple that even a child can figure it out:

Technical Features

Under the hood, Perspec uses:

  • Haskell for core logic (a rare case of practical use of this language)
  • ImageMagick for image processing
  • Automatic correction algorithms (OTSU for B/W, perspective transformations)

Here's what a typical conversion command looks like:

magick input.jpg -distort Perspective '8,35 0,0 27,73 0,66 90,72 63,66 67,10 63,0' -crop 63x66+0+0 output.jpg

Use Cases

  1. Document digitization — turn a stack of papers into neat PDF files
  2. Whiteboard notes archiving — save brainstorming sessions and lectures
  3. Photogrammetry — preparing images for 3D modeling
  4. Old photo restoration — straightening yellowed snapshots

Installation

For macOS, the easiest way is to use Homebrew:

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

Or download a pre-built release from the releases page.

Alternatives

If you need something more powerful, check out:

Perspec is one of those rare tools that does exactly one thing, but does it perfectly. If you regularly need to tidy up photos of documents or whiteboards, it will save you hours of manual work. At the same time, the project remains simple and easy to use — no complex settings or cluttered interfaces.

Related projects