What is the default JPEG quality? ImageMagick 92, OpenCV 95, Pillow 75, sharp 80, and in ffmpeg it depends on the picture
On this page
- Most tools write 75, 80, 92 or 95, as their source or documentation says
- ImageMagick's 92 keeps full colour, and OpenCV's 95 doesn't
- ffmpeg's default isn't a quality: on our full-size pictures it equalled -q:v 6 to 10
- WebP defaults are 75 or 80, and OpenCV's is lossless
- Of nine tools, only ImageMagick reuses the quality of the JPEG you give it by default
- Type a number, and look at what it costs
- How we measured
We saved five photographs with nine tools and set no quality on any of them, so each wrote its default: 92 in ImageMagick, 95 in OpenCV, 80 in sharp and 75 in Pillow. ffmpeg didn't use one quality at all: what it wrote depended on the picture. Per tool, the median JPEG ran from 123 KB (ffmpeg) to 406 KB (OpenCV), and the median score from 71 to 94 on SSIMULACRA 2, a perceptual scale where 70 is "high quality". ImageMagick's files were 2.5 times Pillow's for the same pixels. Our advice is near the end: type a number, and start at 75 or 80.
Most tools write 75, 80, 92 or 95, as their source or documentation says
Each tool below was called with no quality argument. Quality is the number whose standard JPEG tables the file carries, read back from the file. Chroma is how colour is stored: 4:4:4 keeps it at full size and 4:2:0 at half the width and height (chroma subsampling). Size and score are medians over five 1800x1200 photographs; the tests below also use two graphics, a desktop screenshot and a social card.
| Tool, called with no quality | Quality in the file | Chroma | Size | Score |
|---|---|---|---|---|
ImageMagick 7.1.1, magick in.png out.jpg |
92 | 4:4:4 | 387 KB | 93.9 |
OpenCV 5.1.0, cv2.imwrite |
95 | 4:2:0 | 406 KB | 89.2 |
Chrome 158 canvas, toBlob and toDataURL |
92 | 4:2:0 | 308 KB | 89.2 |
| sharp 0.35.5 | 80 | 4:2:0 | 169 KB | 78.0 |
| Pillow 13.0.0, PHP GD 8.4.28, libvips 8.16.1, Intervention Image 3.11.10 and 4.4.1 | 75 | 4:2:0 | 152 KB | 75.8 |
| ffmpeg 7.1.5 | none, see below | 4:4:4 | 123 KB | 71.0 |
Every quality number except ffmpeg's is also the one in the tool's own source or documentation, linked from its name (the PHP manual says "about 75").
FFmpeg's documentation of its mjpeg encoder lists two options, and neither is a quality.
ImageMagick's 92 keeps full colour, and OpenCV's 95 doesn't
At the same quality 92, ImageMagick's median file is 1.26 times Chrome's (387 against 308 KB) and scores 93.9 against 89.2. The difference is chroma: ImageMagick stores colour at full size from quality 90 up, and a Chrome canvas keeps 4:2:0 at its default 92 (post 25). OpenCV's 95 comes with 4:2:0: its files were 1.05 times ImageMagick's size and scored 4.7 points lower.
One page still says "The default quality setting used in ImageMagick is 85". The source writes 92 unless the JPEG it's reading has a quality of its own, and the test below checks that half.
ffmpeg's default isn't a quality: on our full-size pictures it equalled -q:v 6 to 10
Without -q:v, ffmpeg 7.1.5 wrote files that matched none of the standard tables, so there's no quality to print. What we could find was the fixed setting each file equalled. For every picture, exactly one -q:v from 1 to 31 gave byte-identical output: 10, 7, 6, 8 and 7 for the five photographs, 10 for the desktop screenshot and 8 for the social card. Copies of one photograph at 100, 400, 1,200, 1,800 and 3,600 pixels wide matched 3, 4, 5, 6 and 6, and a 400x300 crop matched -q:v 1 and 2, which wrote identical files.
Setting -b:v didn't move it. Both -b:v 200k and -b:v 20M gave the default's bytes on all seven pictures, although the documentation gives 200K as the default bitrate. Neither the documentation nor the pages we found say where the choice is made. Two newer static builds, ffmpeg n8.1.3-41 and n9.0.2-963, picked the same -q:v for all seven.
To get a fixed quality, type one. A lower number is better, and these are the medians over our five photographs:
-q:v |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|
| Size, KB | 298 | 218 | 185 | 153 | 133 | 123 | 112 |
| Score | 85.6 | 82.7 | 79.5 | 75.7 | 73.3 | 70.7 | 68.9 |
WebP defaults are 75 or 80, and OpenCV's is lossless
A WebP file doesn't record a quality, so we compared each file's quantizers with the ones cwebp -q N produces for the same picture (post 2 traces how cwebp turns a quality into a quantizer). Four tools matched 75, four matched 80, and OpenCV's files weren't lossy at all.
| Tool, called with no quality | WebP written | Size | Score |
|---|---|---|---|
| ffmpeg 7.1.5, ImageMagick 7.1.1, libvips 8.16.1, Intervention Image | cwebp -q 75 |
71.5 to 71.7 KB | 67.0 |
| Pillow, PHP GD, sharp, Chrome 158 canvas | cwebp -q 80 |
91.5 to 91.8 KB | 71.0 to 71.1 |
| OpenCV 5.1.0 | lossless | 1,177 KB | 100.0 |
Going from 75 to 80 added 28 percent to the median file and 4.1 points to the score. OpenCV's header says a WebP written without a quality is lossless (a cv2.IMWRITE_WEBP_QUALITY makes it lossy), and ours were. Their median size was 16.5 times ffmpeg's WebP and 12.9 times Pillow's; our five photograph PNGs had a median of 2,137 KB.
Of nine tools, only ImageMagick reuses the quality of the JPEG you give it by default
We saved one photograph at quality 60 (90 KB, score 69.0 against the PNG) and re-saved it with each tool, again with no quality:
| Re-saved with | Quality written | Size | Score |
|---|---|---|---|
| ImageMagick | 60 | 74.9 KB | 68.9 |
Pillow with quality="keep" |
60 | 89.9 KB | 68.9 |
| sharp | 80 | 90.6 KB | 68.2 |
| ffmpeg | none, see above | 78.6 KB | 67.3 |
| Pillow, PHP GD, libvips, Intervention Image | 75 | 108.1 to 108.3 KB | 65.3 |
| OpenCV | 95 | 195.1 KB | 68.9 |
| Chrome 158 canvas | 92 | 114.3 KB | 68.8 |
ImageMagick's reader estimates the quality of the JPEG it opens and its writer reuses it, as the source says. The other eight went to their own defaults, ffmpeg's included: its file equalled a fixed -q:v 5. Pillow can reuse it too with quality="keep", which raises an error once you convert or resize the image. OpenCV's file was 2.2 times the input's size and scored 68.9 against the input's 69.0. The four tools at 75 made a bigger file that scored 3.7 points lower. That's one photograph, saved once.
Type a number, and look at what it costs
These calls each wrote quality-80 tables on our test photograph (ffmpeg has no 80, and its -q:v 4 scored 79.5 on our photographs; the Intervention Image rows use its GD driver, $manager = new ImageManager(new Driver())):
| Tool | Quality 80 |
|---|---|
| ImageMagick | magick in.png -quality 80 out.jpg |
| OpenCV | cv2.imwrite("out.jpg", img, [cv2.IMWRITE_JPEG_QUALITY, 80]) |
| Pillow | img.save("out.jpg", quality=80) |
| sharp | sharp(file).jpeg({ quality: 80 }).toFile("out.jpg") |
| PHP GD | imagejpeg($im, "out.jpg", 80) |
| libvips | vips copy in.png "out.jpg[Q=80]" |
| Intervention Image 3 | $manager->read("in.png")->toJpeg(80)->save("out.jpg") |
| Intervention Image 4 | $manager->decodePath("in.png")->save("out.jpg", quality: 80) |
| Chrome canvas | canvas.toBlob(cb, "image/jpeg", 0.8) |
This is what each quality costs in Pillow, the median of our five photographs:
| Pillow quality | 60 | 70 | 75 | 80 | 85 | 90 | 92 | 95 |
|---|---|---|---|---|---|---|---|---|
| Size, KB | 114 | 142 | 152 | 175 | 253 | 296 | 310 | 406 |
| Score | 64.9 | 71.3 | 75.8 | 78.0 | 82.5 | 88.4 | 89.2 | 89.2 |
On these photographs quality 70 scored 71.3, past the 70 mark that SSIMULACRA 2 calls "high quality", and the 80 mark, "very high", needed a quality between 80 and 85. We'd start at 75 or 80 and look at the file. Past 92 you pay a lot for a score that has stopped rising.
If you'd rather not choose, Iminify is ours, and its Smart level searches each picture for a quality instead of applying one. On the same five photographs it wrote a median 125 KB at a median score of 77.1, and all seven JPEGs came out byte-identical when we ran them a second time.
How we measured
The five photographs come from Iminify's published showcase: prepared masters at 1800x1200, saved at quality 92, camera-style rather than straight off a camera, by A. Topolyanskiy, Ben Moore, Anders Jildén, Roberto Nickson and Luke Chesser on Unsplash. The two graphics are a Wikipedia desktop screenshot (from Image compression, CC BY-SA 4.0) and our own social card. We saved each as an 8-bit PNG and gave every tool that PNG, so all of them started from the same pixels.
The calls were ffmpeg -i in.png -frames:v 1 out.jpg, magick in.png out.jpg, vips copy in.png out.jpg, cv2.imwrite("out.jpg", img), img.save("out.jpg") in Pillow, sharp(file).toFile("out.jpg"), imagejpeg($im, "out.jpg") in GD, Intervention Image's save, and a canvas's toBlob and toDataURL, with .webp and imagewebp for WebP. Chrome was headless 158.0.8127.37 on Windows. The rest ran in containers with no network: Debian 13, Node 20, PHP 8.4.28 (GD, and Intervention Image on its GD driver) and ImageMagick 7.1.1-43. The newer ffmpeg builds were BtbN's static n8.1.3-41-ga8029b6528 and n9.0.2-963-g4d831360c9 of 25 November 2026.
We read JPEG quality back from the quantization tables, comparing them with the tables libjpeg-turbo's cjpeg writes at each quality from 1 to 100. A file "carries quality N" when both its tables match cjpeg -quality N's. For WebP we compared the four segment quantizers with cwebp -q N for N from 0 to 100.
Scores are SSIMULACRA 2 from libjxl 0.12.0's ssimulacra2, against the PNG each tool read. ssimulacra2 can't open ffmpeg's JPEGs, so we decoded every JPEG with djpeg first and every WebP with dwebp. KB means 1,024 bytes. Iminify's files came from its API on 26 November 2026.
We didn't test ffmpeg builds for Windows or macOS, Firefox, Safari, Photoshop, GIMP, Paint, phone APIs, PHP's Imagick, Intervention Image's Imagick driver, or the AVIF and PNG defaults.