AI-Powered Screenshot Tool With Built-in OCR for Complex Mathematical Formulas

Here is a screenshot tool that is also an AI tool. It lets you take screenshots of forumals and extract them in LaTeX format. Also works for text extraction from images. And yes, it offers local AI integration.
Warp Terminal

I take a lot of screenshots for work. Most of the time, though, I don't need the image itself. I need the text, the command or the formula inside it.

On Linux, I usually reach for the Extract Text option in Spectacle. It works, but stops at plain text. If the screenshot has a table, a math formula or a chunk of code, I have to resort to manual work.

Snippai tries to fix exactly that. It's an open source snipping tool that sends your screenshot to an AI model, figures out what kind of content it is, and gives you the matching output. Be it a LaTeX for a formula, Markdown for a table, clean code for code, and so on.

I tested Snippai on CachyOS with KDE Plasma and Wayland used Google Gemini as the AI provider with my own API key. I also tried using Ollama with Qwen 2B but that did not work well on my modest system.

Snippai main window in Auto mode with a drop area and Snip, Select text and Drop or paste shortcuts
Snippai main window

Snippai: Screenshot tool with built-in AI-based OCR tool

The idea is simple. You snip a region of the screen (or drop and paste an image), and Snippai shows the result right next to it. By default, it runs in Auto mode, where the AI decides what the content is and picks the right action for you.

If Auto guesses wrong, or you want something else, there's a row of tabs on top. Each tab is an "action" with its own prompt behind it:

  • Formula: LaTeX for printed or handwritten math
  • Text: plain OCR, including handwriting
  • Code and Explain: extract code or explain anything in the image
  • Table: Markdown table, with export to Excel
  • Solve: answers the question shown in the image
  • Image and Color: describe the image or list its main colors
  • Translate and Calendar: translate text, or turn event details into an .ics file

It's an Electron app with builds for Linux, macOS and Windows, although the official website only talks about macOS and Windows. Weird, I know. But the developer reached out to It's FOSS so we gave it a try anyways.

Note that Snippai doesn't ship its own AI model. You plug in an AI provider, cloud or local. That also means your snips go to the cloud AI you used, so keep that in mind before snipping anything sensitive.

Installing Snippai

For Linux, Snippai provides DEB and RPM packages along with a plain ZIP archive, for both x64 and ARM64.

Since I was on CachyOS, an Arch-based distro, neither DEB nor RPM was the right fit. So I downloaded the Linux ZIP, extracted it and ran the app from there.

Once running, Snippai sits in the system tray. On KDE Plasma, right-clicking the tray icon gives you some options like Show Snippai, Take Screenshot, Toggle Sticky Notes and Quick Action on Clipboard Text.

Snippai tray menu on KDE Plasma with Show Snippai, Take Screenshot, Toggle Sticky Notes and Quick Action on Clipboard Text
Snippai options in the KDE Plasma system tray

Setting up an AI provider

Snippai is useless until you give it an AI model to talk to.

Go to Settings -> LLM Providers. OpenAI (gpt-4o) and Google Gemini (gemini-2.0-flash-lite) are already listed, and you can add more with the buttons at the bottom.

LLM Providers page in Snippai settings listing OpenAI and Google Gemini, with Add provider buttons
Default LLM providers in Snippai

Each provider has a name, a base URL, an API key, an optional organization ID and a list of models. There's also a Test button to check that everything is set before you save.

Snippai Edit provider dialog with name, base URL, API key, organization ID and models fields
Editing an LLM provider in Snippai

I created a new provider called "Google Gemini AI", added my Gemini API key and the gemini-3.5-flash-lite model. You can keep several providers and toggle the one you want to use.

Custom Google Gemini AI provider with the gemini-3.5-flash-lite model enabled in Snippai
Custom Gemini provider added and enabled

After that, pick the model from the drop-down on the main window.

Model drop-down in the Snippai main window with gemini-3.5-flash-lite selected
Select the AI model from the main window

Taking a snip

You start a snip with Take Screenshot from the tray menu. The app shows Ctrl+Shift+A for this, but the global shortcut didn't work for me on Plasma Wayland. The tray menu worked every time.

After selecting an area, you get a small toolbar. The checkmark sends the snip for recognition.

Snippai selection around Ramanujan's series for 1/pi on a web page, with the capture toolbar below
Snipping a formula from a web page

You can skip snipping altogether too. Drop an image on the main window or paste it with Ctrl+V, and it goes through the same process. That's how I tested the photos of my handwritten notes.

Putting Snippai to work

Here's how each action did in my tests. One thing to keep in mind that most actions give you source code, not a rendered result. You get LaTeX, Markdown or iCalendar text that you copy and paste into an app that renders it.

Formulas to LaTeX conversion

I snipped Ramanujan's series for 1/Ο€ from a web page. Snippai picked the Formula action by itself and gave me a clean LaTeX source along with a rendered preview. It matched the original exactly.

Snippai Formula tab showing a rendered preview and LaTeX source of Ramanujan's series for 1/pi
Formula converted to LaTeX with a preview

Then I tried something harder: a photo of two SchrΓΆdinger equations I wrote on paper, and not very neatly. It got both right, including ℏ, the partial derivatives and the hats on H, and even put them in an aligned block.

Photo of handwritten Schrodinger equations converted to LaTeX in an aligned block by Snippai
Handwritten SchrΓΆdinger equations converted to LaTeX

Switching to the Explain tab on the same formula gave a proper explanation. It identified the formula as Ramanujan's, from 1914, and explained each symbol.

Snippai Explain tab identifying Ramanujan's 1914 formula for pi and explaining each symbol
Explain tab on the Ramanujan formula

Handwritten text

I gave it a fairly messy handwritten line. It read the whole thing correctly. To be honest, I'd have struggled to read some of those words myself after some time and I am not even a doctor.

Handwritten note read by the Snippai Text tab as 'Linux was first released in 1991 by Linus Torvalds'
Handwritten text recognized correctly

Tables

I snipped a small table of Git commands. Snippai returned it as a Markdown table, with the angle brackets escaped so they don't break the Markdown. There's also an Export as Excel button.

Table of Git commands converted to a Markdown table by Snippai, with an Export as Excel button
Table converted to Markdown

Code

For code, I took a screenshot of part of the script from It's FOSS's compress-pdf project. The Code tab extracted it with the indentation intact.

Python code from the compress-pdf script extracted with indentation by the Snippai Code tab
Code extracted from a screenshot

The Explain tab on another part of the same script gave a line-by-line breakdown. It correctly figured out that the code parses command-line arguments and checks whether Ghostscript is installed.

Snippai Explain tab giving an overview and line-by-line breakdown of a Python main function
Line-by-line explanation of the code

Solving problems

The Solve action is where the AI part shines. I gave it a programming problem.

Count the ways to climb 12 stairs, 1, 2 or 3 at a time, without landing on the broken step 7

It explained the dynamic programming approach, wrote a Python program and walked through each step to the answer, 355. That's correct.

0:00
/0:17

Solving a programming problem with the Solve action

Then I tried a classic pipes-and-tank math problem which also was solved correctly as expected. By the way, don't replace your problem solving ability with AI all the time. I was just testing these things.

0:00
/0:11

Solving a pipes-and-tank math problem

Describing images

I gave it a screenshot of an 8086 CPU pin diagram. The Image tab described it as a 40-pin DIP package and then listed each pin with its label. Handy if you want a quick text version of a diagram, or a starting point for alt text.

8086 CPU pin diagram described by the Snippai Image tab as a 40-pin DIP with each pin listed
Image description of an 8086 pin diagram

Picking colors

I snipped the It's FOSS home page and used the Color tab. It listed the main colors in hex, with what each one is used for: teal for the banner and buttons, dark charcoal for the background, and so on.

It's FOSS home page with its dominant colors listed in hex by the Snippai Color tab
Main colors of the It's FOSS home page

Translation

I used a short Japanese paragraph about Ubuntu. Translate turned it into proper English. You can change the target language from the drop-down above the result.

Japanese paragraph about Ubuntu translated to English in the Snippai Translate tab
Japanese text translated to English

Calendar events

This one surprised me. I snipped the details of a Fedora Linux 45 release party, with date, time, location and description. The Calendar tab turned it into a valid iCalendar entry, and there's a Save .ics button to save it as a file.

Fedora Linux 45 release party details turned into an iCalendar entry with a Save .ics button in Snippai
Event details turned into an iCalendar entry

Quick actions on copied text

Snippai also works on text you've copied. Pick Quick Action on Clipboard Text from the tray menu, and it opens with the clipboard content and a set of text actions like Rewrite, Translate, Solve and Explain.

To test it, I copied a sentence about Linux full of grammar and spelling mistakes. The Rewrite action fixed the first half but left "alot of computor's" and "servor arround the wurld" untouched. That was a bit odd.

Snippai Rewrite action on clipboard text leaving some spelling mistakes uncorrected
Rewrite action missed some mistakes

Custom actions fix that

This is where custom actions come in. In Settings -> Actions, you can add your own action with a name and a prompt. You choose whether it applies to images, text or both, whether it gives an answer or replaces the text, and the output format.

Snippai custom action editor with name, prompt, Applies to, Result and Output format options
Creating a custom action

I created a "Fix Grammar" action with a prompt to correct spelling, grammar and punctuation without changing the meaning. Running it on the same sentence fixed every mistake.

Custom Fix Grammar action in Snippai correcting every mistake in the clipboard sentence
Custom Fix Grammar action fixed everything
πŸ’‘
You can also edit the prompts of the built-in actions in the same place. So if an action doesn't behave the way you want, tweak its prompt instead of giving up on it.

It's a regular screenshot tool too

You don't have to send every snip to the AI. The capture toolbar has rectangle, ellipse, arrow, pen, text and pixelate tools, with a few colors and sizes. Annotate your snip and save it with the download button.

Snippai capture toolbar with shape, arrow, pen, text and pixelate tools and color choices, used on an article
Annotation tools in the capture toolbar

There's a Long screenshot button on the same toolbar for scrolling captures, with options for auto-scroll speed in the settings.

Long screenshot button on the Snippai capture toolbar over a web article
Long screenshot option

Sticky notes

Click the pin button on a result, and it turns into a small floating "Snippai Note" window with the snip and its result. It stays on screen while you work, and you can hide or show all notes from the tray with Toggle Sticky Notes.

Floating Snippai Note window with a snip and its result, and Toggle Sticky Notes in the tray menu
A result pinned as a sticky note

The account login didn't work

There's a Login button at the top of the window. When I tried to register an account from the app, it failed with an email rate limit exceeded error. Everything above worked without an account using my own API key, so it isn't required.

Final thoughts

Since I am still learning the ropes of local AI on a modest laptop, I could not make it work with Ollama. I tried Qwen 2B but the model is too small and the context perhaps was too much for it.

Snippai is more suited for people in academics who have to deal with a lot of forumals. Students or people working on digitizing old hand-written notes may also benefit from it.

It recognized everything I threw at it: handwriting, formulas, code, a pin diagram, a translation and an event description. The LaTeX and calendar outputs are the most useful parts for me, and custom actions let you shape it around your own workflow.

Sure, the main power is the LLM used here. You may also just paste these things in a cloud AI tool like chatGPT or Claude and it may work the same but having it in a dedicated tool is better for focused work, I think.

Also, for academics and people who have access to better GPU for local AI tools, Snippai could prove a tool worth trying for.

You can get Snippai from its official website and find the source code on GitHub.

What do you use to grab text from screenshots on Linux? Let me know in the comments.

If this helped you, consider supporting It's FOSS

It's FOSS has been helping people use Linux for the past 14 years. Help us stay independent from big tech. Become a Plus member, enjoy ad-free reading and get 5 eBooks.

Plus yearly

Ad-free, FREE ebooks

Join yearly

Buy us a coffee

Any amount, no commitment

Support on Ko-fi
About the author
Sreenath

Sreenath

Linux tinkerer by day, Lord of the Rings fanatic by night. When I'm not busy conquering the command line, you can find me kicking back and watching some football while quoting JRR Tolkien

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

itsfoss happy penguin

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.