I use Flameshot combined with Tesseract and zbarimg to quickly clip areas of the screen and either OCR them or decode barcodes, which I then map to hotkey combinations.
For example, I have `bash -c 'flameshot gui -s -r | tesseract - - | gxmessage -title "Decoded Data" -fn "Consolas 12" -wrap -geometry 640x480 -file -'` mapped to Super+O, so I can just press the key combo, select a region of the screen, and have the OCRed text immediately displayed in a dialog box from gxmessage (which accounts for most of the command line). Replace 'tesseract' with 'zbarimg' and you have a barcode scanner.
Nice! Once you start getting complex, a standalone script might be a good idea. But it should be noted that your ImageMagick processing can also be inserted into the original one-liner:
Last year, when I want to find a tool to do the sanpshot and OCR job, I found flameshot. However, the OCR feature hasn't been added as native function due to some issues I'm not very clear.
So I spent some time added the OCR function into flameshot. I didn't choose to compile tesseract into flameshot, but using the rest api way to call a server running remotely. The reason for this way is I also added llama.cpp translation feature after OCR.
Here're github repositories for my fork of flameshot and the OCR and translation server which is written causually in Rust.
For Linux users who also use Google Photos already, you may not realize this but the Google Photos web app accepts paste from system clipboard via Ctrl+V in the browser. Thus, my workflow if I want to save a screenshot for later is to call up flameshot in rectangular selection mode (I bind it to the PrtScn key), select my screenshot area, Ctrl+C to copy it to clipboard, navigate to GPhotos web app via address bar / bookmark bar shortcut, and Ctrl+V to upload there.
The nice thing about this is that GPhotos recognizes it as a screenshot (so I can find it on my phone later, too, for example). And, GPhotos also automatically indexes any text within the screenshot, so free text search can often find it, too.
If I need the screenshot as a file for some other purpose, I'll navigate to it in GPhotos and use Shift+D to download it.
I can also use GPhotos to privately share the screenshot with someone via their email address, or get a tokenized link for it.
Just sharing this tip because I notice a lot of people hunt around for cloud storage for desktop screenshots. But Google Photos works pretty well for this purpose already, if you use the paste-to-upload trick!
I use the following script (activated by a system-level shortcut key) to take a screenshot, upload to S3 bucket (using the minio client[0]) and place the URL in the X selection buffer, ready to be pasted:
I forget, do you pay for bandwidth serving from S3 in this case? I have been looking for a good screenshot hosting solution to replace Cloudup, which was perfect and still usually works but I figure it might stop any day now. My only worry would be the unlikely case of a surprise high bill from a screenshot gone viral or something along those lines.
Having briefly tried it I have to say it's not as clear or easy to use as ShareX (another open-source screenshot tool). The monochrome icons are really not intuitive or easy to discern at a glance.
Another commenter asks why it's not possible to trigger with the PrtScn key and I would also think that is an essential feature.
I found it to be the exact opposite. ShareX has a lot of features which makes it hard to quickly get your head around all its clutter, when sometimes all you want to a screenshot utility.
Flameshot has key bindings just like any other screenshot program. If the shortcut is already bound by another program, then it will not let you bind it to Flameshot, I believe.
I have been using Flameshot portable for years and it isn't without missing features but I keep coming back to it. I generally use the copy function, sometimes save to location. It would be good to have a built in editor that can be loaded after the action.
FYI, [Win + Shift + S] is quickest way in windows to copy selected area to clipboard, if that's all you need.
I use it nearly everyday for something e.g. posting snap of a code snippet or anything in slack to putting these clips in docs.
EDIT: Just tried Flameshot and loved that I can draw while taking a snap, instead of opening a new window and do the drawing in that. Looks like this is going to replace Win+Shift+S for me.
Thats the reason I stopped using win+shift+S, to draw on snippet right away. Now if only I could do 2 snippets and merge them into one pastable immage in flameshot..
I'm a big fan of Greenshot. My only issue with it is that it's not available on Linux, which I use occasionally.
Re Flameshot, I've tried it and it generally works well for me. My only beef is that the layout of the icons around the captured area is dynamic, changing based on the shape and size of the area, requiring me to actively search for an icon instead of finding it in a static, predictable location.
I worked for an organization with more than 150000 employees. All their PCs had Greenshot pre-installed and it was part of their standard software. Greenshot was used a ton over more than a decade, maybe still is, and (observed from my limited view) loved very much.
They never payed a cent to the developer - shame on them.
For example, I have `bash -c 'flameshot gui -s -r | tesseract - - | gxmessage -title "Decoded Data" -fn "Consolas 12" -wrap -geometry 640x480 -file -'` mapped to Super+O, so I can just press the key combo, select a region of the screen, and have the OCRed text immediately displayed in a dialog box from gxmessage (which accounts for most of the command line). Replace 'tesseract' with 'zbarimg' and you have a barcode scanner.
So I spent some time added the OCR function into flameshot. I didn't choose to compile tesseract into flameshot, but using the rest api way to call a server running remotely. The reason for this way is I also added llama.cpp translation feature after OCR.
Here're github repositories for my fork of flameshot and the OCR and translation server which is written causually in Rust.
https://github.com/jason-ni/flameshothttps://github.com/jason-ni/flameshot-ocr-server
Deleted Comment
For Linux users who also use Google Photos already, you may not realize this but the Google Photos web app accepts paste from system clipboard via Ctrl+V in the browser. Thus, my workflow if I want to save a screenshot for later is to call up flameshot in rectangular selection mode (I bind it to the PrtScn key), select my screenshot area, Ctrl+C to copy it to clipboard, navigate to GPhotos web app via address bar / bookmark bar shortcut, and Ctrl+V to upload there.
The nice thing about this is that GPhotos recognizes it as a screenshot (so I can find it on my phone later, too, for example). And, GPhotos also automatically indexes any text within the screenshot, so free text search can often find it, too.
If I need the screenshot as a file for some other purpose, I'll navigate to it in GPhotos and use Shift+D to download it.
I can also use GPhotos to privately share the screenshot with someone via their email address, or get a tokenized link for it.
Just sharing this tip because I notice a lot of people hunt around for cloud storage for desktop screenshots. But Google Photos works pretty well for this purpose already, if you use the paste-to-upload trick!
https://developers.google.com/photos
Another commenter asks why it's not possible to trigger with the PrtScn key and I would also think that is an essential feature.
Flameshot has key bindings just like any other screenshot program. If the shortcut is already bound by another program, then it will not let you bind it to Flameshot, I believe.
I have been using Flameshot portable for years and it isn't without missing features but I keep coming back to it. I generally use the copy function, sometimes save to location. It would be good to have a built in editor that can be loaded after the action.
ShareX can pop up an editor after a screenshot which I do use a lot.
And configuring it to a the print screen button just involves assigning it, and in the case of Ubuntu, overriding system defaults.
Perhaps it's harder on Windows?
I use it nearly everyday for something e.g. posting snap of a code snippet or anything in slack to putting these clips in docs.
EDIT: Just tried Flameshot and loved that I can draw while taking a snap, instead of opening a new window and do the drawing in that. Looks like this is going to replace Win+Shift+S for me.
Nowadays (at least for me on Win11) it's also bound to the PRNTSCRN button, which is a nice way to redeem an otherwise anachronistic key.
Re Flameshot, I've tried it and it generally works well for me. My only beef is that the layout of the icons around the captured area is dynamic, changing based on the shape and size of the area, requiring me to actively search for an icon instead of finding it in a static, predictable location.
They never payed a cent to the developer - shame on them.
[1] https://getgreenshot.org/
BTW I've never heard of Ksnip before. I gotta try it.
Flameshot v11.0.0 - https://news.ycombinator.com/item?id=30071766 - Jan 2022 (30 comments)
Flameshot – Simple, powerful screenshot tool for all major operating systems - https://news.ycombinator.com/item?id=26446070 - March 2021 (125 comments)
Flameshot – Superb Screenshot Tool - https://news.ycombinator.com/item?id=26113753 - Feb 2021 (83 comments)