Skip to content

gojxl v0.2.0

Latest

Choose a tag to compare

@bdrtr bdrtr released this 14 Nov 08:35

Faster single-thread decoding, grey images stored as grey, a thread cap for servers and a faster JPEG recompression effort.

Decoding

  • Gaborish and all EPF iterations now run in one pass over rows (bit-identical output): on one thread a 2 MP photo decodes in 77 instead of 87 ms at distance 1, 82 instead of 93 ms at distance 2 and 126 instead of 151 ms at distance 4.5; with GOEXPERIMENT=simd, 57 instead of 72 ms at distance 1.
  • The output curve tables are built once per process instead of per decode: a 256×256 image decodes in 2.5 instead of 3.7 ms.
  • Against the other Go libraries (timed again with a warm-up, see the README): gojxl decodes lossy files 14–15 % faster than gen2brain/jxl on 4 threads; on one thread gen2brain/jxl, which uses SIMD assembly, is 2–10 % faster (v0.1.0's README said about twice as fast; those runs were probably cold).

Encoding

  • Grey images are stored as grey also when lossy or with alpha, and colour images whose samples are all grey (as grey+alpha PNGs decode) become one channel: decoders write grey PNGs for them.
  • TranscodeJPEGEffort: efforts 1–3 code the DC coefficients with a fixed context model, about 15 % faster on one thread for 0.7 % larger files; the default is unchanged. ConvertToJXL and the CLI's -e now pass the effort on for JPEG input.

Servers

  • SetMaxThreads(n) caps the goroutines a conversion computes on, process-wide; with 1 a conversion starts no goroutine.
  • A panic in a worker goroutine (malformed input reaching a bug) now reaches the caller as an error instead of ending the program.

Install: go install github.com/bdrtr/gojxl/cmd/gojxl@v0.2.0 (Go 1.24+), or download a binary below and check it against SHA256SUMS. The macOS binaries are not notarized: run xattr -d com.apple.quarantine gojxl after unpacking if macOS blocks them.