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.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.