Flameshot – Open-source screenshot software
flameshot.org
flameshot.org
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.
#!/bin/bash
screenshot=$(mktemp)
decoded_data=$(mktemp)
processed_data=$(mktemp)
cleanup() {
rm "$screenshot" "$decoded_data" "$processed_data"
}
trap cleanup EXIT
flameshot gui -s -r > "$screenshot"
convert "$screenshot" \
-colorspace Gray \
-scale 1191x2000 \
-unsharp 6.8x2.69+0 \
-resize 500% \
"$screenshot"
tesseract \
--dpi 300 \
--oem 1 "$screenshot" - > "$decoded_data"
grep -v '^\s*$' "$decoded_data" > "$processed_data"
cat "$processed_data" | \
xclip -selection clipboard
yad --text-info --title="Decoded Data" \
--width=940 \
--height=580 \
--wrap \
--fontname="Iosevka 14" \
--editable \
--filename="$processed_data" bash -c 'flameshot gui -s -r | convert - -colorspace Gray -scale 1191x2000 -unsharp 6.8x2.69+0 -resize 500% png:- | tesseract - - | gxmessage -title "Decoded Data" -fn "Consolas 12" -wrap -geometry 640x480 -file -'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/flameshot https://github.com/jason-ni/flameshot-ocr-server
/opt/homebrew/Caskroom/flameshot/12.1.0/flameshot.app/Contents/MacOS/flameshot gui -s -r | tesseract - - | (text=$(cat) && osascript -e "display dialog \"$text\" with title \"OCR Result\" buttons {\"OK\"} default button \"OK\"")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!
#!/bin/bash
set -e
dbus-update-activation-environment DISPLAY XAUTHORITY
FNAME=`cat /dev/urandom | tr -cd 'a-f0-9' | head -c 32`.png
flameshot gui --raw > /tmp/$FNAME
~/go/bin/mc -q cp --attr x-amz-acl=public-read /tmp/$FNAME s3/your.s3.bucket/dir/$FNAME
echo -n https://s3-us-west-2.amazonaws.com/your.s3.bucket/dir/$FNAME | xsel
[0] https://min.io/docs/minio/linux/reference/minio-mc.html $ publish example.png
https://example.com/+umk3cm5cah5akbqeueq8914zimfktoih
And for when it matters, the filename can optionally be attached: $ publish --named example.png
https://example.com/+umk3cm5cah5akbqeueq8914zimfktoih
$ http --headers 'https://example.com/+umk3cm5cah5akbqeueq8914zimfktoih' | grep 'Content-Disposition'
Content-Disposition: inline; filename="example.png"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.
Thank you for pointing out that ShareX has an editor. I was aware that it has that feature but I do not remember the specifics on why I went back to Flameshot.
The lacking features of Flameshot is that once you move away from the editor, you can not go back and make alterations. Not that I am aware of anyway.
Also, Greenshot is lighter and snappier than every other Windows screenshot application I've tried.
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.
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)
I know I sound like I am just repeating the title, but that's my honest, user opinion too. Does what it says it does, does it well, and stays out of your way until you want to use it.
You just resize Peek‘s transparent window over the part of the screen that you want and hit record
Flameshot (despite being available on Windows) helped make that transition really pleasant! I mentally put it in the LINUX HAS BEEN GOOD column.
Works well in XFCE, KDE Plasma, and Cinnamon - notso in Gnome because, well, Gnome. I wish it did video too. Until it does, I am using SimpleScreenRecorder - which is okay.
There was a period where any screenshot/recording app didn't work at all, including Flameshot, due to limitations in Wayland implementations.
Seems very simple to me and avoids browsers, cloud storage, and other potential pitfalls.
But flameshot is extremely fast and does 95% of what I'd do in gimp anyway, without having to open a whole image editor and saving a picture. I can directly copy it to the clipboard and paste it somewhere.
I'm actually about as likely to just pull out my phone and take a picture of the screen as to use software-based screenshots.
Having said that, I wish we can select the objects (e.g., text box, arrows) we have created and move them around. Right now, we can only undo and if an arrow is drawn a few steps before and now you want to reorient its head, you are out of luck.
In the past (4-5 years ago), I used to use Jing (now called TechSmith Capture) and liked it a lot: https://www.techsmith.com/jing-tool.html and liked it. But I think the company decided to remove some features and/or require some sort of account creation; on top of that, it (if I remember correctly) kind of lost its earlier simplicity, so I stopped using it.
On Windows I like to use Greenshot because the editor opens up in a dedicated window and gives me full control over the objects I place (move, resize, change colors, duplicate, cut-copy-paste, reorder, save objects to file for reuse...). It's also open source, but seems unmaintained for some time now (but there is a fork implementing zoom in the editor).
Every screenshot tool I've ever come across has a blur tool but no cut tool. So I just use the OS specific screenshoter and then load it up in an image editor and cut to my hearts content.
But the fascination is easily explained - it looks better as it "fits" the rest of your image vs having some jarring black rectangle
I've never ever seen that in the wild, but that would def. make it sane to use the blur tool.
It's by no means as feature-rich as ShareX for Windows, but it works perfectly for what I need. It covers the essentials like simple annotations, blocking out areas of screenshots, saving local copies, etc.
I made some tweaks to support my own custom image uploader API, and similar to the comment by geoka9, I have it set up to take a screenshot, upload to my app, and copy the URL into my clipboard all behind a single shortcut.
Thank you for sharing.
I'll have to have a look at this next time I'm on a Linux desktop, as I found the options lacking compared to ShareX last time I looked.
I quickly started using it for myself, it's very very convenient.
I use Windows native screenshot tool because it supports OCR.
https://www.pcworld.com/article/2070861/windows-snipping-too...
I press Win+Shift+S then select the region of the text.
My only wish is for it to be able to open existing files. I wish I could just open an image, make some edits, and save it. Unfortunately, you can only make edits to screenshots.
I want a smoothing slider so I can draw a circle and an arrow with the mouse and not have it look like I have sever palsy with a sclerosis topper.
Maybe someday.
Bonus, this was a piece of ‘bloatware’ an admin rebuilt my computer with, but I came to love.
Not super cool with aesthetics but it's flawless so yeah.
Also on i3 spectacle is sometimes buggy, it misfires or loses the capture.
Click click click, paste in email and reference the numbers… much more clear than arrows and scribbles all over the place.