Bug 460320 - Add OCR feature
Summary: Add OCR feature
Status: CONFIRMED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 20.12.3
Platform: Debian stable Linux
: NOR wishlist
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
: 463177 467942 479412 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-10-12 16:47 UTC by kono93
Modified: 2024-04-18 01:04 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kono93 2022-10-12 16:47:00 UTC
SUMMARY
***
It would be great to be able to OCR screenshots directly, so you can copy text from them or make them searchable via pdfgrep.
This could be done by Tesseract, enabled only if installed, and would kind of easy to add, but very useful.
***
Comment 1 Nate Graham 2023-01-05 18:47:03 UTC
*** Bug 463177 has been marked as a duplicate of this bug. ***
Comment 2 Nate Graham 2023-04-03 23:20:24 UTC
*** Bug 467942 has been marked as a duplicate of this bug. ***
Comment 3 Nate Graham 2023-04-18 19:14:54 UTC
Skanpage is already using Tesseract for OCR, so that could be a place to look for inspiration.
Comment 4 akid.anis799 2023-04-25 04:17:29 UTC
as a workaround one could try to use this command for OCR with spectacle:

For X11:
`spectacle --nonotify --region --background -o /proc/selt/fd/1 |  tesseract stdin stdout | xclip -in -selection clipboard`

For Wayland:
`spectacle --nonotify --region --background -o /proc/selt/fd/1 | tesseract stdin stdout | wl-copy`
Comment 5 Andrea Ippolito 2023-08-07 12:18:29 UTC
Normcap is doing this, although it's a standalone app:
https://github.com/dynobo/normcap/

Maybe worth looking into/getting in touch with the DEV.

May I add, it would be cool if OCR capabilities weren't limited to Spectacle, but somehow baked-in in some frameworks part, and then be usable by any KDE app that can display images by pressing a button and having the detected text appear as overlay (e.g. gwenview showing a photo of a receipt, okular showing a page that was scanned without OCR, etc).

Sounds complex and impacting quite some apps, but would be a wonderful productivity addition (if OCR accuracy is spot-on)
Comment 6 ostap-tymur-tymchenko 2023-08-07 18:29:35 UTC
(In reply to andrea.ippo from comment #5)
> Normcap is doing this, although it's a standalone app:
> https://github.com/dynobo/normcap/
> 
> Maybe worth looking into/getting in touch with the DEV.
> 
> May I add, it would be cool if OCR capabilities weren't limited to
> Spectacle, but somehow baked-in in some frameworks part, and then be usable
> by any KDE app that can display images by pressing a button and having the
> detected text appear as overlay (e.g. gwenview showing a photo of a receipt,
> okular showing a page that was scanned without OCR, etc).
> 
> Sounds complex and impacting quite some apps, but would be a wonderful
> productivity addition (if OCR accuracy is spot-on)

I dont think it would actually be so hard. Tesseract OCR is both very advanced and open source. All KDE would have to do is to have it preinstalled, and then implement it into the apps. obviously implementing it would be a lot of work but having it be in KDE isnt hard.
Comment 7 akid.anis799 2023-11-19 09:53:19 UTC
New workaround for using ocr with spectacle

For X11:
spectacle --nonotify --region --background -o /tmp/screenshot.png && tesseract /tmp/screenshot.png stdout | xclip -in -selection clipboard

For Wayland:
spectacle --nonotify --region --background -o /tmp/screenshot.png && tesseract /tmp/screenshot.png stdout | wl-copy
Comment 8 Noah Davis 2024-04-18 01:04:46 UTC
*** Bug 479412 has been marked as a duplicate of this bug. ***