Join Nostr
2026-11-15 23:30:56 UTC
in reply to

RedTechEngineer on Nostr: > from the few tests I did webp is smaller than jxl in png->webp/jxl, webp->jxl and ...

> from the few tests I did webp is smaller than jxl in png->webp/jxl, webp->jxl and jxl->webp
maybe im rarted, but im not entirely sure what you are saying here, but i'll explain what should theoretically be happening.

webp always discards chroma except in lossless mode. specifically it discards half the chroma resolution using 4:2:0 subsampling,

so surface level conversions may result in smaller webp over jxl, though if you take a closer inspection i doubt jxl will lose most of the time on quality to data usage comparisons (though they have fundamentally different quality metrics so it may win sometimes in special cases)

if you encode a proper lossless png or webp in jxl varDCT mode, you will almost certainly lose quality and balloon the filesize, modular mode is generally inferior for these types of encodes. modular mode supports both lossy and lossless, but is only the default for lossless, vardct is the default (and only works) in lossy. obviously if you had a lossy format converted to png and then to jxl that's a different beast.

if you encode a lossy webp into jxl, you may again lose quality and balloon filesize because now you are forcing jxl to preserve webp artifacts into jxl.

if i were to tl;dr
png -> modular jxl :)
png -> vardct jxl :(
lossless webp -> modular jxl :)
lossless webp -> vacdct jxl :(
lossy webp -> modular jxl >:(
lossy webp -> vardct jxl :(
legacy jpeg -> lossless jpg vardct jxl :^)
legacy jpeg -> vardct jxl :)
legacy jpeg -> modular jxl :(
gif -> jxl :)

or even more tl;dr
lossless input -> lossless jxl (this is not default, pass -d 0 in cjxl!)
jpg input -> lossless jpg to jxl
other lossy input -> lossy jxl

can you clean up my mess of a post and make it more digestible? also somehow mention vardct mode does use modular? i think its important enough to mention but couldnt think of how to mention it without making my post even more of a confusing mess. also how lossless webp always has an alpha channel which is rather wasteful when theres no transparency in the image which jxl doesn't impose. or how xyb is black magic.

CC: @mansalia@maid.zone