What is the default JPEG quality? ImageMagick 92...

What is the default JPEG quality? ImageMagick 92, OpenCV 95, Pillow 75, sharp 80, and in ffmpeg it depends on the picture

By SJ
8 min read
Bar chart of the median JPEG size with no quality set: OpenCV 406 KB, ImageMagick 387 KB, Chrome 308 KB, sharp 169 KB, Pillow 152 KB and ffmpeg 123 KB, marked as varying, beside the headline Default JPEG quality: 75, 80, 92, 95, or it depends.
On this page

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.

Questions this post answers

Share this post

Share on X
Share on Facebook
Share on LinkedIn
Share on Reddit
Share on Hacker News
Email
Copy link
Link copied
Two boxes with areas drawn to the pixel counts: a 4080 x 3072 photo upload of 6.5 MB above the smaller 3319 x 2499 copy of 2.3 MB that Mastodon stored, labelled JPEG quality 75

Does Mastodon compress images? Yes: it re-saves JPEGs at quality 75 and shrinks anything over 8,294,400 pixels

On 25 November we uploaded a 12.5-megapixel Pixel 8 photo of 6.5 MB to a stock Mastodon 4.7.6 server. The server stored a 3319 x 2499 picture of 2.3 MB. Three sources give three different limits: Buffer says 8 MB and about 1.6 megapixels, Mastodon's documentation says 16 MB and 8.3 megapixels, and the server's own API reports 33,177,600 pixels (33.2 megapixels). We ran the server, read its code, and fetched 968 stored images from 121 public servers.

7 min read
Bar chart of what PowerPoint 2024 stored for five files, in MB in and MB stored: JPEG photo 6.5 to 4.9; the same photo as WebP 3.5 to 22.9; as AVIF 3.0 to 4.8; HEIC 0.72 to 0.43; PNG screenshot 0.31 to 0.31.

Does PowerPoint compress images? In our Office 2024 for Windows test it re-encoded big photos and turned a WebP into a PNG

We ran 18 pictures through PowerPoint 2024 for Windows from a script, each into its own deck, then unzipped the saved deck. The 6.5 MB Pixel 8 photo came out as a 4.9 MB JPEG, 3,284 pixels wide, without its GPS position. A 3.5 MB WebP came out as a 22.9 MB PNG. A phone screenshot came out byte for byte as it went in. So PowerPoint does compress some pictures. It measures a photo in pixels per inch (ppi) at its size on the slide. Above 330 ppi it swaps a JPEG or PNG photo for a copy at about 330 ppi (more for our two photos with a rotation tag). In our runs a JPEG was swapped only when the copy was smaller than your file. Word's number is 220 ppi. If you want a small deck, make the pictures small before you insert them.

7 min read
Two cards under the title "Gemini refused our images for pixels, never megabytes": a 734,003,200-byte PNG of a 512 x 512 picture, accepted with HTTP 200, and an 818,478-byte PNG of 16,384 x 16,384 pixels, refused with HTTP 400.

Gemini API "Unable to process input image": our images were refused for pixels, never megabytes

In September 2025, a developer on Google's AI forum sent the Gemini API a 4.3 MB diagram, 20,926 by 18,035 pixels (about 377 million pixels), and got this error: Unable to process input image. Please retry or report in https://developers.generativeai.google/guide/troubleshooting The one reply said an internal error had occurred. The author wrote back that it kept happening, and the thread closed in November 2026 with no further answer. On 23 November 2026 we sent gemini-3.8-flash an 818,478-byte PNG, a flat blue square of 16,384 by 16,384 pixels, and it refused with that message. We also sent it a PNG of 734,003,200 bytes, a 512 by 512 picture padded to 700 MiB by a text chunk, and it described the picture. None of our files was refused for its megabytes, a 101 MiB file of random noise included. Images were refused for their pixels: a JPEG of 225,000,000 passed and one row more was refused, and a side of 42,000 passed where 42,250 was refused. If you only need the fix, skip to the section on shrinking.

8 min read

Try it on your own images

Drop a photograph in, pick Smart, and compare the result with the original before you download. Free, no account needed.