DEV Community

Abdul Azeez V
Abdul Azeez V

Posted on

Snip tool

Hello there, this is my first post here.

I developed a python version of snip tool, similar to the one found in Windows. I was building a OCR related application. I needed to control the screen capture programatically. But the one in windows (WIN + Shift + S) couldn't do it. So i created one using tkinter and PIL package.

sniptool

Usage:

To snip screen directly,

git clone https://github.com/abdxzi/sniptool.git
cd sniptool
python snipping_tool.py
Enter fullscreen mode Exit fullscreen mode

Add in programs,

from snipper import ScreenSnipper

app = ScreenSnipper()
snips = app.snip()
print(snips)

# [<PIL.Image.Image image mode=RGB size=310x250 at 0x228AEDB4D50>, <PIL.Image.Image image mode=RGB size=454x307 at 0x228AEDB4E10>]
Enter fullscreen mode Exit fullscreen mode

Returns PIL Imgae format, which can be further used in programs.

Source Code

Top comments (0)