low quality jpeg compression, exaggerated
Introduction
My Tech-Related Photography Posts
- My Lightroom-to-iPad Workflow
- Lightroom Goodies (lots of plugins)
- Digital Image Color Spaces
- Online Exif (Image Data) Viewer
- Jeffrey's Autofocus Test Chart
- Photoshop Calendar-Template-Building Script
- How to Prepare Photos for an iPad
- A Qualitative Analysis of NEF Compression
- Tripod Stability Tests
more...
One of the first things a photographer learns about image formats is that JPEG image compression is “lossy”, meaning that the smaller file produced by greater compression comes at the cost of lower image quality. How much lower — whether low enough to “matter” — depends on the situation. JPEG compression can be remarkably effective at reducing the size of the image, so despite the lowering costs of storage space and bandwidth, the reduced size is still very appealing: storing essentially the same image in one fifth the file size, for example, means uploading five times faster.
The compression setting is usually controlled in camera with a “basic / standard / high” quality setting, each using progressively less compression. Most image-processing applications, though, use a “0-100 quality” or “0% - 100% quality” sliding scale, and Adobe Lightroom is no exception:
JPEG Quality Setting in the Lightroom Export Dialog
It's easy to figure out that that “Quality: 0” is less quality than “Quality: 100”, but what does it really mean? The JPEG standard is full of complex math that I don't understand, and I suspect you don't either, so it's not exactly intuitive what these “quality settings” (“quality percents?”) really mean. This barrier to understanding is exacerbated by the fact that different applications tend to implement the settings in different ways, so “quality 73” means one thing in one app and another in another.
Adding to the confusion for Lightroom users is the fact that Lightroom's JPEG quality setting is unique: it's different from every other photo-processing app I know, including other Adobe products. “Quality 73” in Lightroom, for example, is not the same as “Quality 73” in Photoshop or any other app that I know of.
Table of Contents
For the rest of this post:
- Lightroom's Two “JPEG Quality” Surprises
- An Example (Sunset and Bird)
- Quality-Inspector Features
- A Totally Different Example (Reed Window Screens)
- Example (Dandelion)
- Example (Bridge)
- Example (Mountainside Buildings)
- Example (Boat at Sunrise)
- Example (Moss and Dandelion Seed)
- Example (Old Wooden Siding)
- About These Examples
- Conclusions
- Additional Resources
- Thanks
Lightroom's Two “JPEG Quality” Surprises
I've been working with digital images for a long time, and have dug around in some aspects to a fairly deep degree (particularly color spaces, raw compression, and white balance), but was surprised by Lightroom's JPEG-quality settings in two respects:
“0 quality” is not zero — With some photos, you get pretty good results even at Lightroom quality 0, more than good enough for web thumbnail use, for example, where the substantial savings in size (often more than a 90% savings!) make the slight tradeoff worth it. “Quality 0” in Lightroom might be roughly comparable to “Quality 50” in many non-Adobe apps.
We'll see some compelling examples below.
“0-100” is really “0-12” — Lightroom maps the 101 points in its 0-100 quality scale to only 13 different quality outputs. Setting the Lightroom quality to 70, for example, results in the exact same output as setting it to 76, or anything in between. 7 is the same as zero, and 93 is the same as 100. The full mappings are shown in the examples below.
Those familiar with Photoshop will recognize 13 as the number of quality settings in Photoshop's Save-as-JPEG option (with 0 being “Low quality”, up through 12 being “Maximum Quality”). I haven't tested whether these are indeed the same except for the numeric scale presented to the user, but I suspect they are.
(For those wondering, Lightroom does not match Photoshop's “Save for the Web” 0-100 scale, either: with “Save for the Web”, a quality of 70 produces a result that is actually different than that produced with a quality of 76, so it can't be the same as Lightroom, where 70 and 76 are identical.)
An Example
Let's look at an example, a lightened version of the shot from this sunset post last month...
Nikon D700 + Sigma “Bigma” 50-500mm OS @ 1000 mm — 1/1000 sec, f/13, ISO 1250 — full exif & map — nearby photos
Sunset and Bird
In the javascript-powered tool in the gray box below, you can see a full-resolution “actual pixels” crop from the photo created at various export qualities. Initially it shows the highly-poserized “Lightroom quality 0” version, but if you mouse over the buttons at the bottom, other versions load, all the way up the scale to “Lightroom quality 100” (the “93〜100” button)....
As you sweep the mouse over the buttons from left to right, there's an initial dramatic increase in visual quality at relatively small costs in increased file sizes, but these trends quickly reverse so that toward the higher-quality end of the scale, there's little to no improvement in visual quality as the file size explodes by leaps and bounds.
To my eye at a glance the 70〜76 quality is just fine, but if I really look carefully with a critical eye, tipping my laptop LCD screen at an angle, I see uneven gradients even in the lossless version. This might well reflect that the sunset sky was not perfectly smooth(!), but the pixel-peeper in me wonders whether this smooth-gradient challenge was too much even for the basic technology of the camera image sensor.
Quality-Inspector Features
In visually comparing one quality level to another, it's very helpful to swap back and forth quickly between the two samples, as it hyper-highlights differences, revealing details of the difference that one would never otherwise notice. While this is useful, it's important to maintain a sense of perspective about what viewers will eventually see and actually notice on their own. Don't let yourself get carried away by raw pixel-peeping alone.
Comparing quality levels:
Comparing adjacent quality levels — Comparing adjacent quality levels is as simple as panning the mouse back and forth between the adjacent quality buttons.
Comparing a quality level versus perfect — Bringing the mouse just below a button reverts the display to the “lossless” perfect-quality version, so sweeping the mouse up and down into the button then below it toggles between the view for that button and the perfect-quality version.
Comparing any two quality levels — Selecting the small circular checkbox below a quality button makes that button the one reverted to when the mouse is brought under a button, so you can select the checkbox for one quality, then move to the button for the other and pan up and down to toggle between the views.
Again, I'd like to suggest keeping this pixel-peeping in perspective. It's easy to let yourself get carried away to the point that you start to find fault where there's not, or finding importance in some minor fault that won't at all be apparent to your intended audience.
A Totally Different Example
Let's look at a photo with very different compression results. Here's an image of some reed shades hanging in front of the window of an old house near my place in Kyoto (the same window seen in this post from last year). It's a fairly boring shot, but I'd thought it might make for an interesting desktop background photo.
Nikon D700 + Voigtländer 125mm f/2.5 — 1/400 sec, f/8, ISO 3200 — full exif & map — nearby photos
Reed Window Shades
This scene has a lot fine detail in the many thin reeds making up the window shades, so you'd be forgiven if your first instinct would be that this image would require high JPEG quality for acceptable results with all that detail, but it's just the opposite: there's almost no difference in appearance between the “Lightroom quality 0” setting and lossless (perfect quality) TIFF output, but the file size difference is remarkable: the TIFF, even when compressed (with lossless ZIP compression) is still more than 15 times larger, while an uncompressed 16-bit TIFF is more than 50 times larger(!)
Again, here are full-resolution “actual-pixel” crops...
As you sweep the mouse over the buttons from left to right, the file size increases considerably as the “quality” goes up, especially in the last few steps where again the size explodes by leaps and bounds, but you really don't seem to get additional visual quality for the extra bytes. Overall, there really doesn't seem to be much difference at all over the entire range, from the the 174k-byte lowest-quality JPEG version to 1.4 megabytes for the highest-quality JPEG version, except perhaps some halos in the low-quality version near the vertical string lines tying the reeds together, but these are gone by the time you get to the next quality level.
Plenty of other differences make themselves known when quickly toggling between views, but in a static view they're mostly lost among the many details of the photo, and I suspect that when presented with the perfect version and the second-to-the-lowest quality version, only those with a trained eye would be able to pick which was which.
The difference from the first example is stunning, and relates to what visual changes human are sensitive to: we pick up on imperfections in a continuous tone much more readily than slight changes in varied detail. The JPEG compression algorithm is built around this difference, trying to preserve quality in these smooth gradient areas, but as well as it does, a photo like the sunset presents a daunting challenge.
The lack of detail in the sunset example is reflected in all versions by a drastically-decreased file size compared to the reed-shade example.... the sunset's smooth gradients compress well, so all quality levels compress much more than their highly-detailed counterparts in the reed-shade example: for the same size result, the lowest-quality versions come in at 34k and 174k respectively, while the highest-quality versions weigh in at 445k and 1.4 megabytes.
One thing I find interesting (but don't understand) is that in the first example, the difference in file size between the 47〜53 quality and 54〜61 quality is considerable (49k to 66k bytes), while in the second example, the the same two levels of quality produces essentially the same file size. There seems to be some kind of switch in compression algorithm once Lightroom is at a quality setting of 54 or above that puts the emphasis on encoding the easily-discernible smooth gradients of the sunset example, and if they are lacking in the image, as with the reed-window-shade example, the attempt at extra quality fails, and the file size does not increase. That's my guess, but it's just a guess.
Let's look at an example mixed with lots of detail and various areas of smoothness...
Nikon D700 + Voigtländer 125mm f/2.5 — 1/400 sec, f/8, ISO 5000 — full exif & map — nearby photos
Messy Dandelion
from the outing that produced this post in May
The areas of fine detail seem to firm up at about the 39〜46 quality level, and the areas of smoothness seem fine there too, but the pixel-peeper in me might want to bump up the quality setting a few levels so that quick toggling reveals less fluctuation in the background.
Five more examples follow, of various types, for your pixel-peeping, compression-understanding enjoyment...
Nikon D700 + Nikkor 14-24mm f/2.8 @ 14 mm — 1/4000 sec, f/5.6, ISO 200 — full exif & map — nearby photos
Uber Challenging
detailed lines and smooth gradients, from this post on the longest suspension bridge in the world
Nikon D700 + Nikkor 24-70mm f/2.8 @ 70 mm — 1/320 sec, f/9, ISO 200 — full exif & map — nearby photos
Boring, but Common
from our room when we stayed at the Westin on Awaji Island
Nikon D700 + Sigma “Bigma” 50-500mm OS @ 500 mm — 1/8000 sec, f/6.3, ISO 200 — full exif & map — nearby photos
Lots of Nondescript Detail
a darker version of this photo
Nikon D700 + Voigtländer 125mm f/2.5 — 1/160 sec, f/8, ISO 5000 — full exif & map — nearby photos
Dandelion Seed and Moss
the same scene as this photo, but at f/8 instead of f/2.5
Nikon D700 + Voigtländer 125mm f/2.5 — 1/320 sec, f/8, ISO 5000 — full exif & map — nearby photos
Old Wooden Siding
Right next to the reed-shaded window of the second example photo
Conclusions
First of all, you can't directly compare Lightroom's JPEG quality settings with any other application. The settings may well map directly to Photoshop's save-as-JPEG 0〜12 scale, and they may well partially map to Photoshop's “Save for the Web” settings, but all bets are off when it comes to the JPEG quality setting on non-Adobe applications. They're just totally unrelated to how Adobe does it. (I should make it clear that the difference is neither good nor bad; I've presented nothing here about how any other application creates JPEGs, so there are no conclusions to draw about which might be better or worse than Lightroom; the important point is to recognize that the scales, even if sharing the same “0〜100” labels, are absolutely completely unrelated.)
The Lightroom default JPEG export quality of 75, falling in the 70〜76 range, seems to provide for as good a visible result as the highest quality setting for all the samples except for the bridge, which seems to suffer at least slight posterization banding at all levels, including even “lossless TIFF”. The file size, even at this relatively high 70〜76 setting, is still about one third that of the 93〜100 setting, so is well worth it in most situations. Those who blindly use the maximum setting for their exports likely waste a lot of local disk space, upload bandwidth, and remote storage space. But conversely, those who blindly use some lesser setting risk posterization in the occasional photo with an unlucky sky gradient.
Overall, my recommendation is to understand the situation, allowing you to avoid acting blindly.
About These Examples
To produce these examples, I used a plugin for Adobe Lightroom to export each photo at Lightroom's 13 different JPEG quality settings, and also as a losslessly-compressed TIFF, at a reduced size of 1518×1010 (down from my Nikon D700's native raw resolution of 4256×2832),* with medium screen sharpening and minimum embedded metadata. These are the versions used for the file-size graphs.
These image files have some extra stuff added by Lightroom — a few metadata items, an embedded thumbnail image, and an embedded sRGB color profile — that is the same regardless of the quality setting, so one school of thought would have me remove them before creating the file-size graphs, to isolate just the quality-related differences among the files. However, I thought it best to leave them there to keep these examples realistic, since since Lightroom will leave them there you export.
The crops you actually see in this post were exported similarly, then converted to losslessly-compressed PNG images for the presentation on this web page.
(Presenting the compressed JPEGs directly would have been problematic because a common browser, Firefox, does not handle display of JPEGs very well, sometimes introducing horrible posterization that does not actually exist in the image.)
This kind of reduced-size test is appropriate for many cases, but less so when you are considering exporting JPEGs for archive, or large JPEGs for print. To address this area, I've created the same eight samples as above, but without any image-size reduction, and without any additional export sharpening. This current web page is already a bit heavy, image wise, so I've placed the full-resolution images on a separate page, here.
Additional Resources
JPEG Export Quality Tester plugin for Lightroom
I created a plugin to quickly generate JPEG copies at all quality settings, my JPEG Export Quality Tester Lightroom Plugin. You can use it for your own testing. It's one of the 20+ wide-ranging Lightroom plugins I've published on my Lightroom Goodies page.
Full-Resolution Examples
As I wrote in About These Examples above, I have created full-native-resolution copies of all these tests. They are available here: Lightroom JPEG Export-Quality Settings, Full-Resolution Examples.
Lots of Lightroom Goodies
I've got 20+ plugins for Lightroom, as well as other writeups and tools, on my Lightroom Goodies page.
Other Digital-Image / Photography Tech Writeups
All kinds of stuff at my Photography Tech page.
Thanks
Thanks to Adobe for making a wonderful photo-workflow program, Marc Liyanage for his CoreImageTool command that allowed me to automate the post-Lightroom conversion to PNG for the 224 sample-crop images, Google for their very useful Chart API that generates and serves the filesize-graph images on the fly, and to the hundreds of people in my mail/comment queue that I have not responded to in the last few days, for your patience as I yet again let myself get sucked into another damn-fool project of my own devise.
| * | The bridge photo was actually a bit smaller than the others to begin with because it required a fair amount of rotation to bring the bridge towers to vertical; I'd taken the picture with one hand while holding the camera out the window of the car, and was concentrating on driving and on not dropping the camera more than on the finer details of composition. |
Hi Jeffrey,
Every now and then you stumble across a Really Useful Web Page. One that does not only provide the information you so desperately need, but ont that provides you with additional insight conveyed in clear language not cluttered with tribal lingo.
Marvellous page. Thanks for saving me hours of testing.
Best regards
Jo Dohl
Oslo, Norway
To echo the comments of others; thanks for an informative write up on the grading of Lightroom’s JPG settings. Saved me loads of testing time with my own photo library.
Thank you for this terrific article! So well done – thorough and clear… This will save people a tonne of time in experimenting and comparing on their own. This article is a great resource for anyone who wants to save a significant amount of disk space, while making an informed decision about the visible (or not) trade-off in image quality.
Very interesting study. Have you performed any tests of opening a JPEG, modifying it and then resaving it. As I understand the issue, a jpeg that was originally saved at 80%, opened and modified and then resaved at 80% will show a degradation in quality with each new saved generation. If I know it might be modified again, would it be better to originally save it at a higher quality, say 95% so the second generation file would start out better and thus show better quality? I shoot in RAW, hopefully to avoid this since saving images in the camera as JPEGs would create this similar condition.
Dear reader,
“portraits in JPG”:
assuming some smooth area, the AC components of JPG would be zero.
the Fourier DC component of an 8×8 (perhaps subsampled) block would be 8 times the average of the 64 pixels (sum of sum of all samples times cos(0)*cos(0) / 4 / (sqrt(2)^2) );
meaning a DC quantization factor of <=8 would impose virtually no loss to smooth areas in theory.
Despite of rounding errors due to YPbPr conversion matrix.
Kind regards,
Jochen
In this old post, you don’t mention the Lightroom version you were using. Lightroom is currently up to version 5.3. Has there been any improvement in the JPEG handling mentioned in your post?
Thanks for the article – and all the excellent plugins.
Alan
Alan Haynes Photography
San Diego, California, USA
I don’t know of any changes to Lightroom’s JPEG-rendering engine. —Jeffrey
Hi Jeffrey.
Huge thanks for all the work you did on this subject. I compress images for my website and need to keep them high quality so I’ve been using a setting of 73. Looking at your examples and experimenting with my own images I can drop them down to the 54–61 range without compromising the quality.
It baffles and annoys me that Adobe have done it this way instead of being upfront that there are only actually 13 levels to choose from. At least now with your explanation I’ve got a clearer understanding of what’s going on and what the compression setting numbers actually are.
Thanks again.
Matthew
Hi, Really informative post, thanks!
My question is this, I take photos for a company that covers sporting events, sometimes up to 3000 images per day. Camera settings (Canon 7D) set to smallest jpg, resulting in files that vary between 600kb and 1mb on the CF card. If I import those files in to LR, even leaving all Develop settings at zero, then export them the file size will more than double! Any idea why this is happening ?
Sometime this isn’t an issue, on an overcast day the dynamic range of the image is fine and I can upload the files to the company server straight from the card. However on a bright sunny day it can be useful to apply a little lightening of the shadows and darkening of the highlights to mitigate the contrasty conditions. The trouble is that these minor adjustments coupled with the unexplained size increase mean I have 2-3 times more data to upload than I think should be really necessary.
I’d guess you’re exporting from Lightroom at a higher JPEG quality setting than the camera is using. Try lowering the setting until the file size seems comparable. You might also consider my Metadata Wrangler plugin to remove the thumbnail and any metadata you don’t need, to reduce the size further. —Jeffrey
Thanks a ton for the article.
Started learning photography and after all the editing, this saved me when wondering how would it make a difference. And specials thanks to JS comparison.
I have now set the Quality at 75. Should be more than enough for personal photos.
Wonderful post. Many thanks
First like everyone else who learned that 0-100 is more like 1-12 I have to say thanks for taking the time to do this and explain it so well.
However I for one will continue to use 100 for every export. My reasons 1:
1. At some point in the future I may use other software to further modify the image. Yes I should go back to the original but for minor tweaks I probably won’t. Yes I can open up lightroom and export again IF the format of the catalog doesn’t change AND the software is still available for my platform. The bottom line is that extra disk space is worth it. If I really wanted to optimise for viewing on the web, sure I’d be looking at lowering quality setting to 75.
2. I’d be interested to know how well the comparative qualities print. Screen display is hardly the most demanding form of display.
3. The one key flaw in your presentation is the resize. It invalidates a lot of your findings. I’m more interested in 100% crops. I already knew I could export at lower size and quality for web display. That’s not the only thing all of us do with our images though.
Hello, thank you for this post. Very usefull to know which quality to choose to display my pictures on my website. Bye.
very useful article and thanks a lot. I have shared the link on my Facebook page for others to benefit.
Fantastic post. Thank you so much for the photos and information. Best article I’ve seen on the topic.
Hi Jeffrey, I’m writing from the UK.
I notice in the graphs above that there is an anomaly at 50%. I wondered if this was a mathematical synchronicity thing or if there was something special about this setting.
Much obliged, great article, I’ve shared it with my colleagues and students.
Si
I don’t understand the exact details, but I believe that’s where the underlying JPEG quantization tables (how many bits are used to encode what kind of data) shift from one setting to another. —Jeffrey
Thank you Jeffrey, I wondered if the “roundness” of 50%, 25% etc would come into it somewhere…
All best
Si
Hello,
I use blogger recently to host some of my images I captured .Images are captured in raw fomats and saved as jpeg and in 100% quality . In my pc there is no drawbacks in images . but when I post the mages into my blogger named Discrete . All images are got more saturated and noises are huge I don’t understand why this is. I just uploaded only two photos because of losses. there some links to other sites
help me!!! Please
You should perhaps be asking Blogger what they’re doing to your photos between your upload and the user’s browser’s download. —Jeffrey
To Romi
Blogger works together with Picasaweb, but since May 2013 these pictures are automatically “enhanced” due to a stupid Google setting and that causes the changes you describe. You will need to extend your account to get access to G+ in order to switch-off auto-enhancement and to undo the enhancement of the pictures attacked. No other solution, but a rather complicated change.
Perhaps more wise to stop with Blogger at all and to start a fresh high quality blog on WordPress.
Rinus
PS: jpegs at 100% quality are absurd large – use 95% instead. For Blogger is 160opx wide enough.
First, thanks for the great article!
It looks like the article and comments are all geared toward saving a jpeg for the web.
Would the article or advice be different for saving to print? Or for saving from one Adobe
product to another, i.e. shoot in RAW, process in Lightroom, Export to Adobe InDesign as
jpeg, then print from InDesign?
Thanks!!
I don’t have much experience with printing, but it seems like little cost to use a higher quality in this situation, because the file size really doesn’t matter so doesn’t “cost” anything. —Jeffrey
If you want, you can make progressive JPEG for web page without recompression and loss of quality online, without any software or from mobile phone: http://imgonline.com.ua/eng/make-jpeg-progressive-without-compression.php
Progressive jpeg save 3-5% more space than baseline jpeg with the same quality.
For compression with (or without) deleting EXIF data you can use this online tool: http://imgonline.com.ua/eng/compress-image.php
Also you can compress jpeg file using online tool – http://www.imgonline.com.ua/eng/compress-image.php
Or make file size smaller by 2-3 percent without compression here: http://www.imgonline.com.ua/eng/make-jpeg-progressive-without-compression.php
Thanks! This is exactly what I was looking for.
Hi,
Thanks a lot for the effort.
I always exported at 100% just to avoid any “unnecessary” quality loss. Thanks to your very helpful post I can now save a lot of space and feel confident about it.
This is an absolutely brilliant explanation of the quality settings.
Thanks.
Thank you very much, Jeffrey, for the detailled analysis … and Happy New Year 2016 !
Jeffrey, This was extremely helpful. I always struggle with this and never really understood what was going on. Thanks so much for the information, and for the plugin. Just trying it out now for Zenfolio.
I am concerned about applying your teaching to images I am sending to a higher grade photobook company. Wouldn’t the lower JPEG size show in an 6×9 print?
Thanx
It depends on what you mean by “lower” (how low?), the content, and the kind of print. If it’s a one-time upload for a printed book, I personally would rather upload in a non-compressed format, or indeed upload at a really high quality. 90% or 100% are probably overkill, but I’d rather be safe than sorry. —Jeffrey
Great informative website. Like really great , like i usually do not comment on any websites, but i made an exception just for you:P
Thanks for the very prompt response. I think I’d rather be safe than sorry when paying for a $90 book.
Herb
I have found the jpeg quality settings in Lightroom and Photoshop to be quite confusing. Now, after reading your article, I have a much better understanding of why. I would have found it difficult to recreate all the comparisons that you have made and very much appreciate your time and efforts in providing this information.
I gather from the article, if you were exporting jpeg for high quality or fine art prints, you would personally use the highest setting or close to it. Is that correct?
Thanks again and happy photo trails!
Yes, for one-time exports, I go ahead and use the highest quality settings that they’ll accept… 16-bit TIFFs if possible, but JPEG at 100% quality otherwise. It’s likely gross overkill, but for a one-time export where quality is the only concern, overkill is better than underkill. —Jeffrey