4 ms·
Gotta say I really don't like all these sites that re-encode images (even more so with videos) and claim that "we can reduce filesize with, like, no quality los
by Daiz 12y ago
Gotta say I really don't like all these sites that re-encode images (even more so with videos) and claim that "we can reduce filesize with, like, no quality loss using our Super Duper Compression Magic!" Because no, it's not magic, you're just re-encoding images, and possibly doing lossless optimizations on top of that (though who knows, they might even think the re-encoding is all the "optimization" an image might need already). Just look at this quick comparison I made, you can clearly see the JPG compression artifacts in the TinyJPG "optimized" version (which turned my optimized 1.27MB original JPG into a crummy-looking 431KB JPG): http://screenshotcomparison.com/comparison/101286 http://screenshotcomparison.com/comparison/101286 (this is a crop from the original image).
Rather than letting a service re-encode your images, you should rather use something that just optimizes them in an actual lossless fashion (optipng, mozjpegtran, or any service that makes use of these), and if you want to squeeze them to an even smaller size in a lossy fashion, then just save your JPGs at lower quality yourself or quantize your PNGs in a controlled fashion (pngquant does a pretty great job with that) - this is especially true with the latter, because haphazard color reduction with PNGs can lead to completely awful-looking results with higher-res images with lots of colors. Here's a comparison for that too: http://screenshotcomparison.com/comparison/101289 http://screenshotcomparison.com/comparison/101289
Bottom line: Feel free to apply lossless optimizations to your heart's content, but anything more than that you're better off just saving to lower JPG quality yourself to begin with (you'll get better results this way too since you're doing just a single lossy encode instead of two) or quantizing your PNGs yourself, provided you actually care about the quality of your images.
EDIT: Figured I could post some more images.
1. Original source image: http://blisswater.info/images/tiny/original.png http://blisswater.info/images/tiny/original.png (4987 KB)
2. JPG quality 90 encode: http://blisswater.info/images/tiny/encoded-q90.jpg http://blisswater.info/images/tiny/encoded-q90.jpg (1033 KB) (encoded with ImageMagick using convert original.png -quality 90 encoded-q90.jpg)
2. Optimized JPG Q90: http://blisswater.info/images/tiny/encoded-q90-optimized.jpg http://blisswater.info/images/tiny/encoded-q90-optimized.jpg (978 KB) (lossless optimization with mozjpegtran -copy none -outfile encoded-q90-optimized.jpg encoded-q90.jpg)
4. TinyJPG result with original.png as source: http://blisswater.info/images/tiny/encoded-tinyjpg.jpg http://blisswater.info/images/tiny/encoded-tinyjpg.jpg (1581 KB)
5. TinyJPG result with encoded-q90.jpg as source: http://blisswater.info/images/tiny/encoded-q90-tinyjpg.jpg http://blisswater.info/images/tiny/encoded-q90-tinyjpg.jpg (485 KB)
As you can see by comparing 2 and 5, there is a very notable quality loss as a result of the TinyJPG re-encode. What's even more interesting is that if you want to avoid double conversion by uploading JPGs, TinyJPG will actually quantize your PNGs first (like their TinyPNG service does), as can be seen in 4 - this is something I was not expecting and find rather baffling as it quite notably alters the source image on its own even before the JPG compression.
- dalke 12y agoI think it's unfair to use as a comparison an image which is outside of the design scope for JPEG. Quoting from http://info.eps.surrey.ac.uk/FAQ/standards.html http://info.eps.surrey.ac.uk/FAQ/standards.html : "JPEG is designed for compressing either full-colour (24 bit) or grey-scale digital images of "natural" (real-world) scenes. It works well on photographs, naturalistic artwork, and similar material; not so well on lettering, simple cartoons, or black-and-white line drawings (files come out very large)."
- jychang 12y agoIt doesn't matter though, a photograph of a low contrast scene with a few blocky subjects would produce the same result.
- molf 12y agoGreat comments. As co-creator of TinyPNG and TinyJPG I agree with you mostly; re-encoding images is not ideal. But it works for many people because a (too high quality) JPEG file is what they have. There are going to be compression artefacts when compressing. The point is that is a fine line where they are unnoticeable for the casual observer but result in huge savings in file size. This fine line can indeed be found manually with a good JPEG encoder and a lot of time. Many people have neither. We made TinyJPG/TinyPNG for people who want to use images on websites (or in apps) that are of high enough quality for casual observers while having very small file sizes. The artefacts in your first comparison image won't be seen by most people from normal viewing distances. So we can mean a world of difference for people viewing your site with a mobile or poor internet connection. It can be the difference between a hero image that takes 4 seconds to load or 1 second to load. If you care about the highest quality possible without any sacrifices in file size at all, then TinyJPG is not for you. >> TinyJPG will actually quantize your PNGs first (like their TinyPNG service does) It's because you uploaded a PNG image – you also got a PNG image back but gave it a "jpg" extension yourself. It isn't actually a JPEG. TinyPNG/TinyJPG have the same back end service. They both accept PNG & JPEG, and currently won't convert between the formats.