Flameshot's --raw flag always writes a PNG-encoded byte stream to standard output, no matter what you name the file afterwards. To control the format and quality of a scripted capture, you have to pipe that stream through an image tool such as ImageMagick: the tool performs the actual conversion, and the flags you pass to it determine whether you get a JPEG at a chosen quality level or a PNG with a different compression effort.
Why renaming the output file does nothing
A script like this one is a common starting point for one-key screenshots on Wayland, where older X11 tools such as scrot often produce black frames:
flameshot full --raw > "$HOME/Pictures/flameshots/$(date '+%Y-%m-%d_%H-%M-%S').png"
The redirection operator only decides where the bytes coming out of flameshot end up. The file extension is purely cosmetic — it labels the file for you and for desktop environments, but it does not transform the data. If you change the extension to .jpg, you get a file full of PNG data wearing a JPEG name. Image viewers may still open it by sniffing the content, but the file has not been converted, and no quality setting anywhere in that command influences the result.
PNG has compression, not quality
The second thing to understand is that PNG is a lossless format. It has no "quality" dial in the way JPEG does, because every pixel is preserved exactly. What PNG does have is a compression level, which changes how hard the encoder works to shrink the file. Raising the compression level can reduce file size, but the decoded image is pixel-for-pixel identical, and the savings depend heavily on the content of the screenshot. If you want genuinely smaller files at the cost of some fidelity, you need a lossy format such as JPEG, which is where a conversion step comes in.
Saving a JPEG with a chosen quality level
ImageMagick can read the PNG stream from Flameshot's standard output and write a JPEG in one step:
#!/bin/bash
set -o pipefail
dir="$HOME/Pictures/flameshots"
mkdir -p "$dir" || exit 1
file="$dir/$(date '+%Y-%m-%d_%H-%M-%S').jpg"
flameshot full --raw |
magick png:- -background white -alpha remove -alpha off -quality 85 "$file"
A few details in that pipeline matter:
png:-tells ImageMagick to read PNG data from stdin; the output filename is what selects JPEG as the target format.-quality 85is an example JPEG quality factor, not a percentage of the original image's quality. Lower values produce smaller, more artifact-prone files; higher values approach lossless territory with much larger files.- The background and alpha options flatten any transparent pixels onto white, because JPEG cannot store transparency. Without this, transparent regions can render as black or garbage.
On systems still running ImageMagick 6, substitute convert for magick; everything else stays the same. The pipefail option makes the script fail loudly if either stage of the pipe errors out, rather than silently writing a truncated file.
Keeping PNG but shrinking the file
If you want to stay lossless — strongly recommended for screenshots containing small text, where JPEG artifacts blur character edges — tune the PNG encoder instead:
flameshot full --raw |
magick png:- -define png:compression-level=9 "${file%.jpg}.png"
This raises the compression effort to its maximum without changing a single pixel. The size reduction varies: screenshots with large flat areas compress well, while photographic content barely benefits. An alternative is to save the PNG normally and optimise it afterwards with a dedicated tool:
flameshot full --raw > "$dir/shot.png" && optipng -o 7 "$dir/shot.png"
Both approaches trade encoding time for smaller files, never image detail.
Practical limits to keep in mind
No combination of these flags increases the resolution of the capture or recovers detail that was not recorded in the first place. Conversion only re-encodes what Flameshot captured. Also remember that every JPEG save is a fresh lossy step: if you later crop or resize a JPEG and save it again, the artifacts compound. A sensible policy is to keep PNG as your archival format and generate JPEG copies only when you need them for web uploads or messaging apps, where the bandwidth savings justify the fidelity loss.
Frequently Asked Questions
Why does my .jpg file still open as a PNG?
Because redirecting Flameshot's --raw output to a differently named file only changes the label, not the data. The stream is PNG-encoded regardless. Actual format conversion requires a tool such as ImageMagick to decode and re-encode the image.
Does -quality 85 mean 85% of the original quality?
No. It is a JPEG quality factor on its own scale, roughly mapping to encoder quantisation settings. Two different source images saved at 85 can look very different, and the number is not a percentage of anything measurable.
Which format should I use for screenshots with small text?
PNG. It is lossless, so text stays crisp. JPEG's lossy compression introduces ringing and blur around high-contrast edges like character strokes, which makes screenshots noticeably harder to read.
Can I improve the quality of a screenshot I already took?
No. These settings only affect how the captured pixels are encoded into a file. They cannot add resolution, sharpen missing detail, or undo compression that was already applied.
Do I need ImageMagick 7 specifically?
No, but the command name differs. Version 7 uses magick, while version 6 uses convert. Check which one your distribution provides with magick -version or convert -version.
Why flatten transparency before saving as JPEG?
JPEG has no alpha channel, so transparent pixels have no defined colour. Explicitly compositing onto a background — white is the usual choice — prevents unpredictable black or noisy regions in the converted file.