Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

JPEG quality?

When I export a RAW file as a JPEG, I can enter a "quality" for the JPEG file, a number between 1 and 12. This seems to affect the file very little. What does this number refer to?

Posted on Jul 6, 2014 9:16 PM

Reply
17 replies

Jul 6, 2014 9:45 PM in response to Edward1064

What does this number refer to

It is the accuracy of the compression. The JPEG compression is lossy. With a low "quality" setting the difference between the original and the compressed image will be greater than with a high quality setting. You will notice the difference, when you are looking at fine details and structures in the images.

Jul 7, 2014 1:55 PM in response to Edward1064

but I am looking for some kind of quantitative answer to the meaning of those numbers.

The problem with the numbers between 1 and 12 is, that they are just one value for the result of a sequence of different lossy and non-lossy compression algorithms, trading image quality for lower file size.

The parts in the processing chain are

  • a low pass filter, this will result in the loss of fine details, and the quality setting will determine the cutoff frequency and the level of quantisation.
  • a series expansion (the discrete cosine transform), and the quality setting will determine the number of coefficients used and thus the accuracy of the approximation by the series expansion.
  • a sequence of entropy encoded segments for a compressed representation of the coefficients.

It is hard to tell from a simple number between 1 and 12, what it exactly will mean for each part of this chain. I have never seen a documentation, how the JPEG codec is exactly implemented on MacOS X machines.

Jul 7, 2014 2:40 PM in response to léonie

Leonie,


Thank you. It would have been helpful if Apple had put some descriptive words around those numbers in their Help documents. Fact is, when I saved a picture at various "quality" levels from 0 to 12, it was difficult to distinguish much difference in them when viewed on my new MB Pro with Retina display. This was true even when the pictures were magnified to almost the pixel level. And the level 0 file was much smaller than the 12 file. Perhaps it would matter more when printed. The original file was a RAW one from my Canon 60D camera.


I would like to hear from other people and their experience.


Thanks again.

Jul 7, 2014 3:28 PM in response to Edward1064

Jpeg is an excellent compression algorithm. The magic of it is that when viewed even at very close detail it is very difficult to see any difference between a high and low quality jpeg.


Until you edit it.


Then, each time the jpeg is saved after editing some data is thrown away, so after a few edit/save cycles you will rapidly see a quite significant difference. That's what lossy compression means.


Apple are using Photoshop as a reference point for presenting this scale, and, frankly, they assume that users of a professional application might understand how jpeg works.

Jul 7, 2014 7:04 PM in response to Edward1064

Also keep in mind that not all images will give the same results at the same quality setting.


That is two images with file sizes of say 10mb when saved at the same quality setting will not produce files of the same size. Depending on the subject matter of the image the sizes of the JPG files can be very different. If one image has a large expanse of blue sky and the other has little sky and lots of foliage of varying shades the first will most likely produce a file size substantially smaller then the second.


So it's really a bit of a crap shoot. Choose a quality setting that gives you the file size that you need for whatever use you need always trying for the largest quality number you can get away with.

Jul 7, 2014 7:21 PM in response to Edward1064

Edward1064 wrote:

Fact is, when I saved a picture at various "quality" levels from 0 to 12, it was difficult to distinguish much difference in them when viewed on my new MB Pro with Retina display. This was true even when the pictures were magnified to almost the pixel level. And the level 0 file was much smaller than the 12 file. Perhaps it would matter more when printed. The original file was a RAW one from my Canon 60D camera.


The Aperture JPG algorithm does an excellent job (and is in no way unique in this). JPG is highly-developed compression format. It is written to preserve detail. What's lost, is quality in large areas of smooth transition. JPG will make every attempt to retain detail. _If you keep the same pixel dimensions_, you won't see very much degradation in _details_.


From a 24 MB RAW (Sony) file 4,000 x 6,000 px, here is a 100% crop (taken with a 400mm lens, subject was c. 7m distant, RAW conversion by Aperture, no adjustments):

User uploaded file


And here is the same 100% crop after saving the Image from Aperture to a JPG file, original size, Quality=2:

User uploaded file

Note, first, the retention of detail. Note, second, the degradation (banding) of the smooth transitions in the background. Third, note that the dark part of the highest whisker, picture-right, is gone in the JPG.


Even at Q=2, the JPG file is 700 KB for a 24 MPix image.


Here are two 100% crops from an Image with detail throughout the frame (same camera type, same lens). First, as displayed by Aperture, and second from a same-pixel-dimensions JPG, saved at Q=2. Again, the subject was fairly distant.

User uploaded file

User uploaded file

This JPG file is close to 1 MB (also 24 MPix).


Again, we see that the details are only lightly softened, but there is significant posterization (pixel binning) wherever the forms get larger.


Now let's return the the first Image. Here is a different crop, this time from an area with little detail (above the squirrel)


User uploaded file


And here is the same area, cropped from the Q=2 JPG file:

User uploaded file

You can see where data has been discarded.


Finally, let's look at a sharp image with some creamy bokeh (do note that this is a 1,025 x 775 crop from the 4,000 x 6,000 original). Same camera, different lens, closer subject. Double-click to view at correct size. As recorded and converted:

User uploaded file


And at same pixel dimensions, but JPG Q=2:

User uploaded file

The full-size JPG file is c. 350 KB.


As a __rough__ conclusion, I'd say that:

- JPG works very well

- Quality setting isn't that important (and needs to be judged vs. file size)

- Downsampling (creating a file with smaller pixel dimensions) is likely to cause more degradation than reducing the JPG quality setting

- And of course, if you don't want to lose IQ, don't use JPG.


(Added a couple of left-out words.)

Jul 7, 2014 8:03 PM in response to Edward1064

Hi Ed,


You're welcome 🙂 .


The squirrels are fun to watch. We have squirrels in all our trees, in town, in a densely populated neighborhood of square blocks. In the parks we see black squirrels — that's what we call them. North of us they have black squirrels that have a truly luxurious black fur. And south of us they have Delmarva Ground Squirrels, which are huge. One fell out of a tree in front of me on day on the edge of a Maryland wood.


I take the pictures for my cat. She likes to watch.

User uploaded file

JPEG quality?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.