Hacker News new | past | comments | ask | show | jobs | submit login
Speed and Size Tests of JPEG XL on Apple Safari (reddit.com)
4 points by scorpio241 on Nov 5, 2023 | hide | past | favorite | 1 comment



Copy&pasted from https://old.reddit.com/r/jpegxl/comments/17o43g2/ran_a_few_s... :

Apple now supports JPEG-XL (a.k.a. JXL) in iOS 17, MacOS 14, and Safari!

This makes me happy, because I'm interested in JPEG-XL for its lossless compression as a replacement for PNG. To test it, I converted a few hundred images and compared...

Total file sizes (gigabytes):

7.93 — PPM (lossless, uncompressed)

1.97 — PNG (lossless, compression=9/9)

1.59 — JXL (lossless, effort=1/9)

1.37 — JXL (lossless, effort=3/9)

1.22 — JXL (lossless, effort=5/9)

1.15 — JXL (lossless, effort=7/9)

1.12 — JXL (lossless, effort=9/9)

1.02 — JPG (near-lossless, quality=100/100)

Total compression times (seconds):

1876 — PNG (lossless, compression=9/9)

28 — JPG (near-lossless, quality=100/100)

11 — JXL (lossless, effort=1/9)

107 — JXL (lossless, effort=3/9)

1802 — JXL (lossless, effort=5/9)

6651 — JXL (lossless, effort=7/9)

98506 — JXL (lossless, effort=9/9)

Total decompression times (seconds):

76.2 — PNG (lossless, compression=9/9)

17.7 — JPG (near-lossless, quality=100/100)

21.2 — JXL (lossless, effort=1/9)

98.0 — JXL (lossless, effort=9/9)

Conclusions:

    Lossless JXL is damn good. Even on its lowest-effort setting, it can improve on PNG's best-case file size by 25%, while doing so 150 times faster. This alone is a big win. On its highest-effort setting (much slower), JXL completely blows PNG out of the water with files about half the size.

    Lossless JXL file sizes can be almost as tiny as the best quality lossy JPEG, if you've got CPU cycles to dedicate.

    Lossless JXL's "compression effort" setting has a much larger impact on elapsed time than it does on file size. Setting effort=9 results in files 70% the size of effort=1, but takes 7000 times longer. Effort settings above 7 (the default) aren't probably worth it. Setting effort=9 costs 15x more time than effort=7 for only 1% to 2% reduction in file size.

    If you're looking for a blazingly fast PNG replacement, try JXL in lossless mode with effort=1.
Tools used for the test:

    netpbm (pnmtojpeg, jpegtopnm, pnmtopng, pngtopnm)
    libjxl (cjxl, djxl)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: