hn.today

JPEG XL with WebGPU makes smaller files than libjxl in 150 KB JavaScript

github.com9 points0 comments
Screenshot of JPEG XL with WebGPU makes smaller files than libjxl in 150 KB JavaScript

Rapier-JXL is a dependency-free JavaScript JPEG XL encoder designed for browsers, workers, Node, and Deno. Its core is about 29 KB gzipped, with a larger still-image worker of roughly 150 KB that adds features including lossy and lossless encoding, HDR, exact alpha, JPEG transcoding, WebAssembly, and parallel lossless compression. A complete worker with animation support is about 214 KB. The project also offers a quality-search API that aims to find the smallest file meeting a target visual-quality score, and an image helper that converts files, bitmaps, image data, or canvases into JPEG XL blobs.

In benchmarks on 24 Kodak images, Rapier-JXL reports files 5-7% smaller than libjxl at the same SSIMULACRA2 quality, and up to 5% smaller when comparing by Butteraugli; it also reports smaller output than AVIF, WebP, and JPEG at the tested settings. Its JPEG-to-JPEG XL conversion restored all 24 test images byte for byte while reducing size by 15%. The project provides benchmark methods and reproduction details. WebGPU can accelerate quality search and encoding: a 12-megapixel phone photo took a reported median of about 2.1 seconds, versus 6.7 seconds on CPU, across 24 photos tested on an NVIDIA T4. GPU support is optional, with CPU fallback.

Read on github.com0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.