A user recently asked:
I always set mage quality to 10. Using all original files. When I look at image size in photoshop, the dimensions are the same(4160x6240 pixels). Saved on drive shows 3.7MB for PixelSugar vs 17MB original. If dimensions are the same, why are file sizes so vastly different?
The SHORT answer is this: saving at 90%-ish in PixelSugar (the default) will produce a good quality JPEG that's visually indistinguishable from the original, a larger JPEG file size doesn't necessarily mean better quality, and if you are concerned about maximum quality, save as a TIFF.
However, this is a whole, big, hairy topic that we could discuss for hours, so here are some additional thoughts, if you're inclined...
What is JPEG? What is compression?
Compressing data means figuring out how to squish it so it takes up less space. Lossless compression allows you to recreate the exact data you began with, byte for byte, while lossy compression attempts to get rid of data selectively, in a way that allows you to reconstruct something close enough to the original. In both cases, compression allows you to store data on disk with less bytes than it actually contains.
For instance, if you have an image that's 3000x2000 pixels, in RGB color mode, with 8 bits per pixel, then the total amount of data in that image is 18 million bytes (or 18 megabytes, abbreviated to 18MB). Saving that image as a JPEG might produce a file that's only 2 million bytes, as the file has been "compressed" with some clever techniques that save space. When you open the saved JPEG version, it will be slightly different from the original (if you compared the value of every pixel to the original), but to your eyes, it should look nearly identical.
JPEG compression is inherently "lossy". This means some image information is discarded in order to save on storage space. PixelSugar, like most image editors, lets you choose an image "quality" setting for JPEGs, which controls the tradeoff between file size and visual quality. Higher quality will preserve more detail in the saved image, but will also produce a larger file on disk.
The algorithm matters
The in-camera JPEG compression of most digital cameras is pretty horrible, and tends to produce larger images than is necessary. Typically, if you open a JPEG from your digital camera, then do nothing but re-save it as a JPEG with maximum quality, you'll see a 25-50% reduction in file size, or even more for an image with low detail.
Incidentally, there's a whole class of software that does nothing except re-compress JPEG images with a more efficient algorithm. Most of the time, this kind of software is able to produce nearly identical-looking images with huge file-size savings. I personally use and highly recommend JPEGMini Lite on the Mac.
Details have a huge influence
A good JPEG algorithm will devote less data to describing image areas that have less detail, while an inefficient algorithm might be more indiscriminate. As a result, the file sizes produced by a good algorithm should vary significantly, based on how much detail is in an image. More detailed images require more data to describe in a way that doesn't look compressed to our eyes, while images with very little detail might end up being compressed to relatively small file sizes, even at the maximum JPEG quality. There's not necessarily a difference in image fidelity between a 17MB JPEG and a 3MB JPEG, if the two files have been produced by different software - one might just use a better algorithm.
Comparing compression settings is hard
There's no industry standard for what a given quality setting means when saving a JPEG. Adobe Photoshop offers 12 different quality settings for JPEGs. Most software offers a quality slider with a range of 0-100. But even then, there's no guarantee of correlation (i.e. 90% in one program might not be the same relative quality as 90% in another).
Even at its maximum setting, JPEG compression will produce some loss of image quality. If you're concerned about preserving the maximum possible image quality, save in lossless format such at TIFF. TIFF files can also be compressed, but in a way that doesn't discard any image data. The resulting files will almost always be larger than a JPEG, but will preserve the exact pixel data from the information you're editing.
What about PixelSugar?
PixelSugar uses Apple's compression algorithms to make its JPEGs. A quality setting of 100 in PixelSugar corresponds to the maximum quality setting available using Apple's algorithms on the Mac. Adobe uses its own algorithms in Photoshop, so there's no direct correlation, but PixelSugar at 90-100% quality will produce a resulting JPEG that's about the same size as a JPEG saved in Photoshop with quality 9-10. Photoshop's quality settings of 11 and 12, while producing very slight improvements in image quality, also VASTLY increase the size of the resulting file, and should generally be avoided (if you're going to get compression ratios of ~50%, you may as well just save to a TIFF).
Trust your eyes
Image compression is a bit of a black art, but in the end, the only thing that matters is that it looks good to you. Start with a high-quality original file (TIFF or Raw), and without making any changes, save JPEG copies at several different quality settings. Then open them up, zoom in, and see if you can tell the difference. Generally, even at 80% quality and above, it's VERY hard to see any difference in the compressed JPEG version, even if you zoom into the image (and remember, 99.999% of the time, nobody is going to be viewing your images blown up at 300%, looking for JPEG compression artifacts). If ultimate quality with no compromises is your goal, save TIFFs, not JPEGs.
Tying this all together
Bringing this back to the original issue - why does my 17MB JPEG end up being 3.7MB when saved in PixelSugar? Without more details, I don't know, but:
- PixelSugar uses a pretty decent algorithm for its compression. It's the same algorithm Apple (probably) uses for nearly all of its own Mac software, and is also used by 99% of all other Mac (and iOS) software for producing JPEGs.
- A JPEG might be way larger than it needs to be, due to inefficient compression (for instance, saving at quality 12 in Photoshop, or a bad in-camera algorithm).
- You should do your own tests. Don't trust me! Save at different settings. See for yourself whether the size savings for lower JPEG quality settings is worth it.
- If you're fanatical about quality, and for critical applications, you shouldn't be using JPEG anyway. Save things in a lossless format if you know for certain that every single pixel needs to be restored to its exact state at some point in the future (but even then, ask yourself... "do I really need it?")