JPG Compression - optimal values?

AnthonyL

Veteran Member
Messages
3,967
Solutions
14
Reaction score
1,248
Location
UK
I shoot RAW then convert to JPG with 98% compression quality. This results in fairly large JPG files but I've never given the compression quality much thought and if I've wanted to save space I've generally downsized the image especially if for viewing on screen only.

The same image has been saved with a different compression (@x = compression) resulting in:

8,950,193 The Great Hall_IMG_7853(@98).JPG
1,536,883 The Great Hall_IMG_7853(@75).JPG
906,546 The Great Hall_IMG_7853(@50).JPG
516,077 The Great Hall_IMG_7853(@25).JPG
259,757 The Great Hall_IMG_7853(@10).JPG

A crop comparison of the above (excluding the 75% file) is:



b4b889def938477fa18ceab8073f5a96.jpg

So to my eyes there is very little difference until I look at the 10% where clearly artifacts are appearing and what appears to be a slight loss of contrast lower than 98% but not changing much till the lower values.

Have I interpreted this correctly and need I be saving at such a high compression ratio?
 
I shoot RAW then convert to JPG with 98% compression quality. This results in fairly large JPG files but I've never given the compression quality much thought and if I've wanted to save space I've generally downsized the image especially if for viewing on screen only.

So to my eyes there is very little difference until I look at the 10% where clearly artifacts are appearing and what appears to be a slight loss of contrast lower than 98% but not changing much till the lower values.

Have I interpreted this correctly and need I be saving at such a high compression ratio?
I've seen a few of these "compression tests" and I've done a some myself. I think that you are on the right track.

BTW, do you mean that you downsize for viewing but not worry about the compression? -That's what's usually done, certainly that's what I do, and I haven't worried JPEG compression for years. I've always regarded the de-facto compression involved with JPEG as quite sufficient without explicitly compressing further.

One of my cameras (Sony a7) has an option to save "Extra Fine" JPEGs, but I honestly can't see the difference between the resulting 18Mb files and standard 10Mb files.
 
Last edited:
Solution
I've been shooting for newspapers, wire and magazines for decades. For what it is worth, we use a #8 or #9 jpeg compression in Photoshop.
 
If you want to save space, the trick might be more emphasis on resizing with less compression.

At my website I use 900px or 1200px as a maximum width, with only 80% compression (I think it's 80%; I'm away from the computer at the moment). The resulting file sizes are nice and small. I may have to adjust that in the future as higher resolution monitors and wider websites become standard.

Of course I save the RAW files from the camera so I can go back at any time and re-do any of the editing or resizing.
 
Have I interpreted this correctly and need I be saving at such a high compression ratio?
The two rules of thumb I keep seeing is that if you want quality, it should be at least 70%; but the last 10% is a huge increase in file size for very little benefit, so somewhere between 70-90% is where you want to be.

I use closer to 70% for uploads that are not that important (social media, email), and closer to 90% for like a portfolio web site or for images that might be printed at the other end at high resolution.
 
This is ancient wisdom that I'm trying to recall, but wasn't there a rule of thumb that if there was more detail in the image (like a closeup landscape photo with lots of tiny leaves or a picture of a tiger with lots of fur detail) you were supposed to adjust your compression one way or another?

Or has the JPEG group been fine tuning the algorithm in the background over the years so that a lot of the issues that we worried about are no longer a problem...until of course Apple makes us all switch to their new file format.
 
This is ancient wisdom that I'm trying to recall, but wasn't there a rule of thumb that if there was more detail in the image (like a closeup landscape photo with lots of tiny leaves or a picture of a tiger with lots of fur detail) you were supposed to adjust your compression one way or another?

Or has the JPEG group been fine tuning the algorithm in the background over the years so that a lot of the issues that we worried about are no longer a problem...until of course Apple makes us all switch to their new file format.
I'm not sure about the first question. It rings a bell, but I'm trying to remember.

About the second question, I don't think the JPEG standard has changed much, although individual applications can and do implement their own algorithms to encode it into the standard, so you see a JPEG from one company look different/better/worse/bigger/smaller than the same image saved to JPEG from a different application at the same settings. There have been attempts to upgrade the standard, like JPEG 2000, which have mostly gone nowhere.

If Apple gets us to switch to HEIF, it is just Apple trying to help out with smaller file sizes than JPEG for the same quality, and a more capable container format for the types of photos shot today. Because the new format is not Apple's format. HEIF is, according to Wikipedia, "developed by the Moving Picture Experts Group (MPEG) and is defined by MPEG-H Part 12 (ISO/IEC 23008-12)." Meaning it is a defined industry standard.

Apple would simply be trying to get everybody to move forward, like when they started implementing Intel's USB standard back in 1998 when the rest of the industry insisted that serial ports were good enough. And they started implementing Intel's Thunderbolt protocol when everyone said USB was good enough. There are still misguided people annoyed by "Apple pushing their proprietary Thunderbolt" on us when it is actually an Intel technology that has some better applications on the Windows PC side today (eGPUs) than on Macs.
 
Excellent points. I bet Steve would flip if he found out that some high end cameras still come with ethernet ports.

And you raise another good point... I wonder what the OP was using to convert the raws. I find that the in-camera raw processor on my Nikon does a surprisingly nice job on many photos.
 
Last edited:
First of all, there is no optimal setting, since we're trading-off between two incommensurate variables; but, for sure, the highest and lowest quality settings can be safely ignored most of the time.

If your space limitations are so great that you must use the highest compression possible, I'd seriously reconsider the graphics aspect of your application, avoiding JPEG or even eliminating photographs and replacing them with far more compressible simple bitmap or vector graphics.

At higher quality settings, JPEG is so good with photographs that the highest quality settings don't give you anything more, but at a much greater file size. This assumes, however, that the JPEG is simply a final output format and not used for intermediate storage for further editing.

If you are going to edit a JPEG, severely apply curves, boosting shadows, changing its color space, etc., then starting with the highest possible quality is highly recommended. But if you are going to be doing this, shouldn't you start with a raw file? Nevertheless, many cameras produce large, high quality JPEGs just for this very reason.

If you edit a JPEG, I've read that it is best to save it at a higher quality setting than the original. But avoid editing and resaving a highly compressed JPEG, as the JPEG artifacts will get strongly emphasized.

Even the best quality setting isn't good enough for some purposes. Line art and text, and crisp graphics with a lot of solid color,is poorly rendered by JPEG, even at the best quality, while the PNG format will compress this perfectly at a much smaller file size. The reason for this is that JPEG discards high frequency signals, and crisp text is practically nothing but high frequency signals. On the contrary, PNG is worse than JPEG when storing photographs.

JPEG typically divides up an image into 8x8 pixel blocks, and if compression is too great. these blocks can be seen in slowly varying areas of uniform color, such as blue skies. However, these blocks typically can't be seen under non uniform detail, and so you can get away with more compression if you don't have smooth areas.
 
You might not see much difference in a comparison side by side. But try a flip of the screen between two levels of the JPG. The Fast Stone image viewer is good for this job. It flips quickly, and you can save at JPG quality levels from 100% down. Good to start with a TIF file and save to desired JPG levels.
 
The main difference between low and high compression is the NOW and FUTURE.

JPG is the 1)lossy 2)compression. The algorithm throws away some unique information before fill in the blank with the average from nearby values.

The higher 'compression' value, the more information it throws away.

Once something is lost, it's forever. Absolute unable to be recovered again.

..

So, to the question of "optimal value" : you alone can decide.

If you satisfy with the low compression image and will not edit this final jpg again, absolutely, the lower the better.

There's no medicine that can cure 'sorry'.
 
Jeffrey Friedl has an interesting article on this subject.

http://regex.info/blog/lightroom-goodies/jpeg-quality
Very helpful and interesting thank you.

One thing that is immediately clear from that article and from postings on here is that it is meaningless to state quality/compression values without specifying the software used as there is no standard. I edit and process RAW with DPP which has a JPG quality slider from 1 to 10 and my default has been 9. Even DPP at 1 is reasonable.

Faststone has a slider (0-100) and a box (5-100), and clearly Lightroom has its own set of values as per the article. Faststone also plays nicely by showing a comparison as the slider is moved along. Low values in Faststone result in quite a poor image. However a value of 96 gives me a 50% reduction in a full screen photo of a bird and I sure can't see anything different viewing at 100%.

However a couple of points that I have observed with a brief bit of testing:

1) The file size curve drops dramatically as quality is reduced from a high value but at around 50% of size I find it hard to detect any loss in the image

2) Losses appear to be more pronounced where there is a smooth texture and banding starts to come into play rather than where there is a lot of detail, though at low quality everything suffers.

I've got some 12,000 images on my computer many of which would not suffer by being downsized and slightly more compressed. This is even more so with my 700D which is taking much larger pictures than the 450D. As I shoot RAW I'm minded to default to lower quality/sizes except for the occasional special image that I might want to print or display to someone.
 
You might not see much difference in a comparison side by side. But try a flip of the screen between two levels of the JPG. The Fast Stone image viewer is good for this job. It flips quickly, and you can save at JPG quality levels from 100% down. Good to start with a TIF file and save to desired JPG levels.
I don't see how to flip if I'm at 100% (Actual) view and if I'm on Fit to screen (Best) I'm not seeing enough detail to make a determination. How to flip on 100%?
 
I've got some 12,000 images on my computer many of which would not suffer by being downsized and slightly more compressed. This is even more so with my 700D which is taking much larger pictures than the 450D. As I shoot RAW I'm minded to default to lower quality/sizes except for the occasional special image that I might want to print or display to someone.
With the default HDD being 1Tb these days, and much larger drives readily available, I think that your concern about file size is misplaced.

If you shoot RAW and are concerned about file size, you would really have to think about processing the RAW files, saving the result as JPEG and then deleting the RAWs. Doesn't make sense to me.

Personally, I can store everything that I ever did in the last 30 years on a $50 1Tb external HDD, and that includes a lot of photography over the last 5 years. YMMV.
 
You might not see much difference in a comparison side by side. But try a flip of the screen between two levels of the JPG. The Fast Stone image viewer is good for this job. It flips quickly, and you can save at JPG quality levels from 100% down. Good to start with a TIF file and save to desired JPG levels.
I don't see how to flip if I'm at 100% (Actual) view and if I'm on Fit to screen (Best) I'm not seeing enough detail to make a determination. How to flip on 100%?
If you use Picasa as the default viewer, you can expand the images as required and then quickly flip between them while retaining the zoomed size.

This is handy for comparing image sequences when carrying out AF-FT -and everyone knows that I zoom to 1000% for a really good view. ;-)
 
I've got some 12,000 images on my computer many of which would not suffer by being downsized and slightly more compressed. This is even more so with my 700D which is taking much larger pictures than the 450D. As I shoot RAW I'm minded to default to lower quality/sizes except for the occasional special image that I might want to print or display to someone.
With the default HDD being 1Tb these days, and much larger drives readily available, I think that your concern about file size is misplaced.

If you shoot RAW and are concerned about file size, you would really have to think about processing the RAW files, saving the result as JPEG and then deleting the RAWs. Doesn't make sense to me.

Personally, I can store everything that I ever did in the last 30 years on a $50 1Tb external HDD, and that includes a lot of photography over the last 5 years. YMMV.
+1 !!

I'm traveling & landscape photographer. Thus I shoot raw + jpg and have to keep those raw for later editing. So each picture requires about 20 MB HDD space.


At 20 MB/pic, the 1 GB disk space can hold 50 pictures.

The 1 TB is 50,000 pics. My last 2 TB Passport external HDD which cost around $100 (cheaper than the rarely used ND-10 filter!) can hold 100,000 pics.

!!
100,000 pics!

!!

If I quickly look at the picture at the rate of 3 seconds/pic, or 20 pics/min, I need 5,000 minutes to completely seeing all pictures.

Or more than 3 days straight without leaving the chair, eating something, go to toilet.

..

I talk about raw+jpg. If only dealing with (almost) zero compression jpeg, the size is around 7 MB. That dirt cheap external HDD will store 300,000 images.

No sane mind could see all those images.
 
I've got some 12,000 images on my computer many of which would not suffer by being downsized and slightly more compressed. This is even more so with my 700D which is taking much larger pictures than the 450D. As I shoot RAW I'm minded to default to lower quality/sizes except for the occasional special image that I might want to print or display to someone.
With the default HDD being 1Tb these days, and much larger drives readily available, I think that your concern about file size is misplaced.

If you shoot RAW and are concerned about file size, you would really have to think about processing the RAW files, saving the result as JPEG and then deleting the RAWs. Doesn't make sense to me.

Personally, I can store everything that I ever did in the last 30 years on a $50 1Tb external HDD, and that includes a lot of photography over the last 5 years. YMMV.
OK so where do you back up your RAW? And where do you back up your processed JPG? And do you just rely on one backup set? How do you manage your $50 1Tb data and backups? And what bandwidth is required? And why don't you store TIFFs as image files rather than throw any data away?

And none of that quite frankly answers my question.
 
You might not see much difference in a comparison side by side. But try a flip of the screen between two levels of the JPG. The Fast Stone image viewer is good for this job. It flips quickly, and you can save at JPG quality levels from 100% down. Good to start with a TIF file and save to desired JPG levels.
I don't see how to flip if I'm at 100% (Actual) view and if I'm on Fit to screen (Best) I'm not seeing enough detail to make a determination. How to flip on 100%?
You are correct about Fast Stone. The context for JPG compression is how much to compress for Web, email, etc. I would never use JPG, even uncompressed, for master copy or archival retention if the raw file or a developed TIF is available.
 
OK so where do you back up your RAW? And where do you back up your processed JPG? And do you just rely on one backup set? How do you manage your $50 1Tb data and backups? And what bandwidth is required? And why don't you store TIFFs as image files rather than throw any data away?
I have three backup drives, and rotate some off-site.

Disk space is inexpensive, and it gets less expensive per terabyte with the larger drives.

I pretty much use raw exclusively, and raw edits are saved by the raw converter in a sidecar file, so if I do a simple conversion, there is no need to save any other kind of file. I do raw conversions as needed, and don't normally convert all of my photos.

If I revisit a photo after some years, I'll typically start from scratch from the raw file.

Usually, I'll use a quality of about 80% when making JPEGs.

TIFFs are bloated, and even with inexpensive drives they are too big, and usually unneeded as I retain the raw files. I often use TIFFs as temporary working files which I delete once I'm done working on a photo. I keep very few TIFFs, only if I did extensive edits and plan on doing more work on them in the future.
And none of that quite frankly answers my question.
Which was optimal JPEG quality? Use 80%.
 

Keyboard shortcuts

Back
Top