一位网络开发者发布了针对JPEG XL与AVIF两种图像格式的详细技术对比研究1。该分析通过对多种类型图像进行编码和解码基准测试,评估了文件大小、编码速度、内存使用和解码性能等关键指标1。
在有损照片压缩方面,AVIF在默认设置下通常比JPEG XL小15-25%,在最大努力设置下差距缩小至6-20%1。然而对于截图和插图,情况相反——AVIF比JPEG XL大30-90%(默认设置)或20-70%(最大设置)1;对于透明图像,AVIF比JPEG XL大31-44%(默认设置)或61-70%(最大设置)1。在处理速度上,AVIF表现出明显优势,其解码速度快2-3倍,同时编码速度和内存效率也更胜一筹1。
在无损压缩领域,JPEG XL展现出显著优势,无损WebP比JPEG XL大9-17%,无损AVIF比JPEG XL大30-120%1。值得一提的是,JPEG XL能够将现有JPEG文件压缩9-20%而无需增加损失1。基于这些发现,作者建议默认使用AVIF 4:4:4配置并采用最高努力级别;若AVIF文件异常大,可考虑使用jixel编码的JPEG XL作为替代方案1。该基准测试采用avifenc 1.4.2、libjxl 0.12.0、jixel 0.4.2及cwebp 1.6.0等编码器版本,在2024年MacBook Pro (M4 Pro)上运行1。
A comprehensive technical comparison of two modern image formats has evaluated their performance across various web use-cases.1 For lossy photographs, AVIF typically produces files 15–25% smaller than JPEG XL at default settings, with the gap narrowing to 6–20% when using maximum effort encoding.1 However, AVIF's advantage in this category comes with tradeoffs in other scenarios: the format generates files 30–90% larger than JPEG XL for screenshots and illustrations at default settings, or 20–70% larger with maximum effort applied.1 For images with transparency, AVIF files are 31–44% larger than libjxl-encoded JPEG XL at default settings, expanding to 61–70% larger with maximum compression.1
Beyond file size, encoding efficiency differs notably between the formats.1 AVIF demonstrates superior encoding speed and memory efficiency, while achieving decoding speeds 2–3 times faster than JPEG XL.1 For lossless compression, JPEG XL shows distinct advantages, producing files 9–17% smaller than lossless WebP and 30–120% smaller than lossless AVIF.1 Additionally, JPEG XL can reduce existing JPEG files by 9–20% without introducing additional loss.1
Based on these findings, the recommendation for web developers is to default to AVIF with 4:4:4 color sampling at the highest effort level, with JPEG XL encoded using jixel as a fallback option for cases where AVIF files become exceptionally large.1 The analysis employed avifenc 1.4.2, libjxl 0.12.0, jixel 0.4.2, and cwebp 1.6.0, with benchmarks conducted on a 2024 MacBook Pro with M4 Pro processor.1
评论
还没有评论,欢迎留下第一条。