A developer shares a code snippet as a screenshot on Twitter. A tutorial blog post renders its examples as images instead of code blocks. Documentation for an internal tool exists only as screenshots of a terminal. The code is perfectly readable, but it's trapped inside an image โ and retyping code from a picture is one of the most reliable ways to introduce invisible bugs.
Why Retyping Code from Images Fails
Code is unforgiving about precision. A missing semicolon, a lowercase L confused with the digit 1, a curly brace versus a parenthesis, an en-dash instead of a hyphen โ any of these will break your code silently. When you retype from a screenshot, you're doing character-by-character visual parsing at a pace that invites exactly these mistakes.
The problem is widespread. Social media platforms convert code to images for prettier rendering. Older documentation was never migrated from screenshots. Slack and Teams messages with code often get screenshotted and forwarded. Internal wikis accumulate years of pasted terminal screenshots that no one has transcribed.
Extract Code Directly from the Screen
Optic reads the code characters right off your screen. Open the screenshot or the page containing the code image, activate Optic from the menu bar, and drag a selection over the code. The extracted text goes to your clipboard, ready to paste into your editor or terminal.
Terminal Commands
Long install commands, Docker run statements, curl requests with multiple flags โ these are commonly shared as screenshots. One drag with Optic extracts the entire command, preserving special characters, flags, and paths that are easy to mistype.
Code Snippets from Social Media
Twitter, LinkedIn, and Instagram posts often render code as images using tools like Carbon or Ray.so. Optic extracts the code from these styled screenshots just as easily as from plain terminal output.
Multi-Line Extraction
Select a block of code spanning multiple lines and Optic preserves the line structure. Paste it into your editor and the code maintains its shape โ no manual reformatting needed. Each capture is saved in your menu bar history, so you can extract several snippets from a tutorial and paste them one by one.