1 Star 0 Fork 1

minphone / textshot

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

TextShot
GitHub stars GitHub forks GitHub license Code style: black

This tool gives users the ability to take a screenshot and copy to the clipboard the text content of the screenshot. Works on Windows, macOS, Ubuntu, Manjaro, and (should work on) most other Linux distros.

TextShot Demo

Use

Running textshot.py will open an overlay over the screen, where a rectangle can be drawn over the portion of the screen containing the text the user wishes to copy.

An optional command line argument can specify the language. For example, python textshot.py eng+fra will use English as the primary language and French as the secondary language. The default is eng (English). Make sure that the appropriate data files for Tesseract are installed for other languages.

It is recommended to attach a global hotkey to this tool.

On Windows, one can accomplish this by using an AutoHotkey script; textshot.ahk contains a sample AHK script that can be used.
On Ubuntu, open the Keyboard Settings, which shows you all the Gnome shortcuts. At the bottom there is a + button to add your own shortcuts. Click it and set the command to /usr/bin/python3 <path-to-textshot.py>. In case you are using a venv, the python3 path above should point to the venv's python3 instead of the global python3.

Installation

  • Install Python 3
  • Clone this repository, and cd into it
  • (Optional) Create a virtual environment, for example with python -m venv .venv
  • Install the required packages with pip install -r requirements.txt
  • Install Google's Tesseract OCR Engine, and ensure that tesseract can be reached from the command line by adding the directory to your system path.

@rigred has added this to the AUR, so Arch Linux users can install the package textshot-git with their AUR helper. For example, yay -S textshot-git.

MIT License Copyright (c) 2020 Ian Zhao Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/minphone/textshot.git
git@gitee.com:minphone/textshot.git
minphone
textshot
textshot
master

搜索帮助