A blog post renders its code examples as styled images. A coworker pastes a screenshot of their IDE into a pull request comment. Documentation for a legacy tool only exists as terminal screenshots on a wiki. Stack Overflow answers include code embedded in images because the formatter mangled the original. In each case, the code is visible and readable, but it's an image — and copying code from an image by retyping it is how you spend thirty minutes debugging a semicolon you thought was a colon.
Code Demands Character-Perfect Extraction
Unlike prose, code has zero tolerance for approximation. A hyphen instead of an underscore breaks an import. A single misplaced bracket makes a function invalid. A lowercase letter where uppercase was needed changes a variable reference entirely. When you retype code from an image, every character is a potential point of failure — and the bugs you introduce are invisible because they look correct at a glance.
The problem is magnified with long commands, multi-line snippets, or unfamiliar syntax. A Docker run command with ten flags, a regex pattern, or a shell pipeline with pipes and redirects — these are exactly the kind of content that gets shared as images and is nearly impossible to retype accurately.
Extract Code from Any Image on Screen
Optic reads the code characters directly from your screen. Open the image, tutorial page, or screenshot containing the code, activate Optic from the menu bar, and drag a selection over the snippet. The recognized text — preserving indentation, special characters, and line structure — goes straight to your clipboard.
Terminal Commands
Install scripts, build commands, and deployment pipelines displayed as terminal screenshots are common in documentation and tutorials. Select the command block and paste it into your terminal with confidence that the flags, paths, and arguments are exactly right.
IDE Screenshots
When a colleague shares a screenshot of their code — in Slack, in a GitHub comment, in an email — extract the code and paste it into your own editor. Test it, modify it, or review it properly instead of squinting at an image.
Multi-Snippet Extraction
Tutorials often show multiple code blocks across a page. Extract each one in sequence. Optic's capture history saves every extraction, so you can work through an entire tutorial and paste each snippet into your project one by one from the history dropdown.