ianzhao05 / textshot Goto Github PK
View Code? Open in Web Editor NEWPython tool for grabbing text via screenshot
License: MIT License
Python tool for grabbing text via screenshot
License: MIT License
on Mac get
INFO: Unable to read text from image, did not copy
seems pyperclip do not work properly on MacOS.
On recent Arch linux with i3wm window manager I often get ERROR: Unable to read text from image, did not copy
.
I have :
很遗憾
Here is an example.
The positions captured by the program:
start:1227,695
end:1272,715
Their real positions:
start:3681,2085
end:3816,2145
Thus pyscreenshot
grabs the wrong image.
My scale factor:
GDK_DPI_SCALE=0.333
GDK_SCALE=3
QT_AUTO_SCREEN_SCALE_FACTOR=0
QT_SCREEN_SCALE_FACTORS=eDP1=3;DP1=3;DP2=3;HDMI1=3;HDMI2=3;VIRTUAL1=3;
Does this repo support Chinese?
I have two screens (let's name them Main and Side). When I open type textshot
in a terminal in Side, the Main monitor starts mirroring Side monitor's content.
So, to copy text from Main, I have to open the terminal in Main. This is not a good experience
好项目呀,感觉很实用,不过我看现在应该是只有英文,之前chineseocr有17M中文识别模型模型,
还有最近百度飞桨新发的,https://github.com/PaddlePaddle/PaddleOCR 只有9M的模型,效果好像还更好一些,
不知道几位大佬,最近有没有计划把中文识别能力集成进去呀?
Hi,
On macOS 11.1, invoking python textshot.py
throws a Qt GUI error:
QPixmap::fromImage: QPixmap cannot be created without a QGuiApplication
QPixmap: Must construct a QGuiApplication before a QPixmap
Any suggestions? This worked fine before updating to Big Sur. Thank you!
EDIT: This has been tried with a virtual environment.
When I run textshot opposite this problem. I show in video. Sorry bad english if I mistake anywhere.
Anyone encountered this phenomena?
I use two monitors , this program can't work
Here is a pyproject.toml
example
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "textshot"
version = "0.0.1"
authors = [
{ name="Ian ianzhao05", email="[email protected]" },
]
description = "Python tool for grabbing text via screenshot"
readme = "README.md"
requires-python = ">=3.7"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
dynamic = ["dependencies"]
[project.urls]
"Homepage" = "https://github.com/ianzhao05/textshot"
"Bug Tracker" = "https://github.com/ianzhao05/textshot/issues/"
[project.scripts]
textshot = "textshot.textshot:main"
[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
[tool.setuptools.packages.find]
where = ["textshot"]
It may need some tweaking and modifying the project to relocate python files in textshot
and changing the way import is done by using something like from .ocr import …
for example.
It would be helpful to make a working package for linux distributions.
You then build and install the package with:
python3 -m build --wheel
python -m installer dist/*.whl
I have created a shortcut in my Ubuntu for textshot and whenever I use it (some times not all the time) the text is copied in French and Not being copied to clipboard at all(this is main issue), I knew it was in French because it was shown in notification :/
ERROR: An error occurred when trying to process the image: (1, "Tesseract Open Source OCR Engine v3.05.00dev with Leptonica read_params_file: Can't open txt Warning in pixReadMemPng: work-around: writing to a temp file libpng warning: Application built with libpng-1.4.3 but running with 1.5.14 Error in pixReadStreamPng: png_ptr not made Error in pixReadMemPng: pix not read Error in pixReadMem: png: no pix returned Error during processing.")
Just a friendly heads up that I've added your package to the archlinux aur and it will keep itself updated based on the latest git commits to the github repo.
https://aur.archlinux.org/packages/textshot-git
So for arch users it's as easy as installing textshot-git
with their favourite aur helper.
yay -S textshot-git
Also is there a way to make textshot pause the desktop (animations like the gif on this page)?
Currently it keeps on animating while in box select mode.
Thanks for the great tool!
screenshot "E:>cd github" output -->"INFO: Copied "AR" to the clipboard"
the command line test info:
E:\github>cd..
E:>cd github
E:\github>cd textshot
E:\github\textshot>python textshot.py
**INFO: Copied "E:\github>cd. .
AR
E:\github>cd textshot" to the clipboard**
E:\github\textshot>python textshot.py chi_sim
**INFO: Copied "ET
E:N>cd github
E:Ngithub>cd textshot" to the clipboard**
E:\github\textshot>
Cropping is incorrect at times. It depends on screen resolution. I have a 4k display and it wasn't performing as expected
Hello the issue is my brain, I can't make it work pls help.
Basically, I can make textshot work via cmd but am too dumb to understand the greatness of your coding skill and btw how autokhey works.
Pls help
When I make a selection starting not from the upper left corner, but from any other corner, instead of the text in selection it returns some long random text, which seems to be the text from all screen.
To reproduce, make a selection of some text from, for example, lower right corner to upper left corner.
Appears to not work on more than 5 words at a time, presents with error
"TextShot"
"An error occurred when trying to process the image: Tesseract process timeout"
Please add a license file.
This tool could only take a shot on its current desktop. However, MacBook has a multi-desktop feature, and you can't ask this tool to take a shot on the desktop where the terminal is opened. Hope the author can support multi-desktop screenshots.
I tried to run textshot on my fedora Linux machine and I got a segmentation fault error:
Traceback (most recent call last): File "/home/maerqin/PycharmProjects/Screenshot_To_Text/venv/lib/python3.12/site-packages/textshot/textshot.py", line 11, in <module> from .logger import log_copied, log_ocr_failure ImportError: attempted relative import with no known parent package [1] 82030 segmentation fault (core dumped) python textshot.py -h
Hi
I think this is a really cool idea to make OCR simple to do and allows for correcting OCR mistakes very easily.
I am on a Windows machine and I find that I need to OCR a large text image in parts because it doesn't handle
a lot of text well. Is there a recommended maximum amount of text that should be selected for conversion?
But even doing OCR in parts, some areas appear to be captured and the "spinning wheel" indicates that
a conversion is being done. But when pasting the text that is in the clipboard to notepad++, it is the text from a prior conversion.
If there is an error in the conversion process, I can't find where it is displayed. Can you please give me some pointers
on getting around these issues?
Thanks!
Sometimes the target is too small on the screen and I can't capture it accurately. Maybe it is a good idea to add a magnified image based on what is around the cursor when users are capturing the screen.
I just downloaded text shot on my Mac and installed all the dependencies but have been experiencing this weird behavior where as soon as I run it it will open a new screen to the right with no open apps and would only allow me to screenshot there. Did anyone else encounter this or have a fix?
2021-02-27 19:08:54.739 Python[952:13732] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/ld/wjmpqdpj1pq2j4j_svh1j8740000gn/T/org.python.python.savedState
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.