![]() It's fast, patent free, supports HDR, transparency, etc., and compression is as good as HEIC. Update for 2022 AVIF seems to be too slow to be practical, so now hope rests on JXL. AV1 is roughly equivalent to h.265, but is patent-free. Update Looking further out, the current hope is AVIF: it's the same container format as HEIC (called HEIF, confusingly), but swaps the problematic h.265 compressor for AV1. It does sadly have some patent issues, you might need to be a little cautious. libheif have some basic command-line tools to encode and decode images. That's libheif, compiled to javascript and running in your browser. It's the format Apple are using by default on iOS now. It uses the much more modern h.265 for lossy compression and typically beats JPG by a factor of two at the same quality. It uses the VP8 codec for lossy, which is only somewhat better than JPG. You can do lossless on the alpha but lossy on the RGB, for example, which is fantastic for overlays.Īgainst JPG it does less well. It beats PNG because it has better lossless compression algorithm than libpng, and it has the great feature of allowing different compression settings for different channels. Just to add a side-comment to excellent answer, webp is a good PNG replacement, but not great as a JPG replacement. Visible degradation is harder thing to measure, but try setting a higher quality, or without specifying a quality at all. Tl dr: In the wild, it may or may not improve file size depending on the type of images, if/how the source file was compressed, and what quality you set for the WebP. On the FAQ page linked above, Google claims: "this is mainly due to the colorspace difference (YUV420 vs ARGB) and the conversion between these." This may have to do with some compression already on my set of test images and how that interacts with the WebP conversion process.Īs I found, file sizes can even grow, usually if you are converting between lossy and lossless images. Both are set to compress at quality 80, but the jpg compression appears to be better. The size of all new jpgs in the directory was 21MB. That's a pretty good savings, however, when I ran ImageMagick's JPG compression, it was even better: convert filename.jpg -sampling-factor 4:2:0 -strip -quality 80 -interlace JPEG filename-new.jpg ![]() Overall, after running that command, the total file sizes of all JPG images was 49MB, while the total file size of all WebP images was 29MB. Some files were dramatically smaller compared to the original JPGs, while others were actually larger. The convert command on this particular server is powered by ImageMagick 6.7.8. For example, I recently ran this command on all jpg images in a folder on a website "in the wild": convert filename.jpg -quality 80 -strip -define webp:lossless=false -define webp:method=6 filename.webp In practice, it depends a lot on your settings and your source images. convert 1.JPG 1.webp # do not specify quality 20% smaller might be a bit much of an ask, though, but it may be achievable for certain images. Just running the default conversion without specifying a lower quality may give you slightly smaller files without loss of visible quality. Quality is largely a subjective measure, but keep in mind that you're comparing a file compressed at quality 80 with a file that doesn't have that level of compression (at least, this is what I understand from your question). However, as you suggest, there in never such a thing as a free lunch. Files using the mac version of the webp command (which uses cwebp under the hood) are about 1/4 of the size of the same file compressed with ImageMagik, and do provide a significant performance boost.Īccording to Google, "WebP typically acheives an average of 30% more compression than JPG" (source) with similar visual quality to a JPG. This is especially true for images with transparency when compared to PNGs. Update Since the time of the original posting, I've discovered that using Google's cwebp compressor shows dramatically improved compression over ImageMagik 6.7.8, which is what powered my initial tests.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |