Skip to content

sashahavrilyuk/lens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lens Screen Snipper

A lightweight Python tool to capture a screen region anywhere on OS and open it directly in Google Lens.

What It Does

  • Shows a full-screen snipping overlay.
  • Lets you drag to select a capture area.
  • Saves the selection as a temporary JPEG.
  • Opens your browser and posts the image to Google Lens.

Requirements

  • Python 3.10+ (tested with Python 3.14)
  • tkinter
  • Pillow

Installation

python -m venv .venv
.venv\Scripts\activate

pip install -r requirements.txt

Usage

python main.py
  1. Drag to select the region.
  2. Release mouse button.
  3. Press Esc to cancel.

Project Structure

  • main.py: app entry point
  • screen_sniper.py: snipping UI and capture logic
  • lens_bridge.py: browser handoff and Google Lens upload
  • requirements.txt: Python dependencies

(optional) AutoHotkey script binding to key

  1. Install AutoHotkey v2.0
  2. Create a new file lens.ahk
  3. Add the following code to lens.ahk:
#Requires AutoHotkey v2.0

F8::
{
    Run 'pythonw "C:\Users\your_username\lens\main.py"', , 'Hide'
}

Change your_username and F8 to your actual username and hotkey.

Notes

  • The tool relies on the current Google Lens upload endpoint and browser behavior, which may change over time.
  • Temporary files are created during execution (captured image and handoff HTML).

About

A lightweight Python tool to capture a screen region anywhere on OS and open it directly in Google Lens.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages