TextSnip is a simple, modern screen capture and Optical Character Recognition (OCR) application written in Java. It allows you to select any portion of your screen, capture the image, and automatically extract the text from it using the Tesseract OCR engine.
- Targeted Screen Capture: Easily snip any section of your screen to capture text.
- Automatic OCR: Uses the powerful Tess4J (Tesseract) engine to extract text from images.
- Image Optimization: Built-in image scaling and enhancements to improve OCR accuracy on low-resolution screen captures.
- Clipboard Integration: Extracted text is automatically copied to your clipboard so you can paste it immediately.
- Image Saving: Automatically saves your snipped screen captures into a local
captures/folder as.pngfiles. - Modern UI: A clean, dark-themed user interface powered by FlatLaf.
- Portable Executable: Can be packaged into a standalone
.exeusing Launch4j, bundled with a custom JRE viajlink.
- Java 17 - Core programming language.
- Tess4J - Java wrapper for the Tesseract OCR API.
- FlatLaf - Modern open-source Look and Feel for Java Swing desktop applications.
- Maven - Dependency management and building.
- Launch4j - Used to wrap the Java application into a Windows executable (
.exe).
To build and run the project from source, you will need:
- Java Development Kit (JDK) 17 or higher
- Apache Maven
Open a terminal in the project's root directory and run:
mvn clean packageThis will compile the application, download all dependencies, and create a fat JAR inside the target/ directory.
You can run the application directly using Maven:
mvn exec:java -Dexec.mainClass="com.snap.App"The pom.xml is configured to automatically do the following during the package phase:
- Build a "fat" executable
.jarfile using the Maven Shade Plugin. - Build a Windows executable
TextSnip.exein thedist/folder using Launch4j. - Bundle a minimized runtime (JRE) using
jlinkand place it indist/jre/.
To distribute the app, simply share the dist/ directory, which contains the .exe and the bundled JRE.
- Open TextSnip, and click the "New Snip" button.
- The application will minimize, and your screen will freeze.
- Click and drag the crosshair cursor to highlight the area containing the text you want to extract.
- Release the mouse. The app will capture the area, save the image, extract the text, and copy it to your clipboard.
- The Snip Preview window will pop up showing the image and the extracted text.
All Rights Reserved - Sineth Dinsara.