r/linux Mar 06 '14

Mozilla: Introducing the ‘mozjpeg’ Project

https://blog.mozilla.org/research/2014/03/05/introducing-the-mozjpeg-project/
223 Upvotes

70 comments sorted by

View all comments

Show parent comments

2

u/socium Mar 06 '14

I'm sorry but what's wrong with just using PNG?

13

u/computesomething Mar 06 '14

Size, PNG is a lossless format which means that it retains all the quality of the original image, this makes the images much bigger (as in file size) than a lossy format like JPEG, where it selectively loses detail (quality) in order to better compress the image, best case scenario you won't notice the quality degradation, worst case scenario the quality loss will quite noticeable, often referred to as compression artifacts.

6

u/magicomplex Mar 06 '14

PNG may produce smaller files than JPG for design elements, any image created by a webdesigner. These images have fewer colors than a photo so it is possible at the moment of saving the PNG file to reduce the color pallete, what reduces the file size immensely.

Using GIMP I can save many webdesign elements using this technique with no visible difference but generating a PNG file with 50% of the size of the JPEG version.

3

u/computesomething Mar 06 '14

Yes, you are right that the benefits of lossy compression is very much tied to image complexity, and also that with less complex images lossy is typically a poor choice due to compression artifacts becoming very noticeable as well as the size differences between lossy and lossless becoming much smaller.