Open roland-5 opened 2 years ago
Yep this is possible and I'm willing to work on it once I gain enough knowledge about encoding with jxl.
https://github.com/image-rs/image/issues/1765 https://github.com/image-rs/image/issues/1765
Related issues. I do not want to do any custom encoding / decoding right now to keep the codebase simple and easy to understand. If it does get implemented in image-rs then I'd be more than happy to expose libwayshot API calls for JXL.
Yeah, JPEG XL is the real deal, especially with the recent 0.10 speedups of reference libjxl
implementation, see here:
https://cloudinary.com/blog/jpeg-xl-and-the-pareto-front
My quick tests show that using is really-really fast (Hyprland, wayshot compiled with -march=native
, Ryzen 5600):
zune-image
supports jpeg xl, but that's another story, right?
That doesn't seem very fast from the numbers shown -- again I might be mistaken in my interpretation. I'm generally against adding new crates to the dependency graph unless unavoidable. Does zune support interop with image crate types?
There are a few zune-
crates behind feature flags for image-rs
, so there is at least some reference of interop between those.
While jxl is cool, it shines brighter when encoding complex stuff like real world photos in high resolution, like shown in the article. And in lossy but visually lossless scenarios.
If we implement png optimization, then jxl gets less attractive for desktop screenshot case. Still an image format to look at, because it's like jpeg, but better in everything, and with lossless mode. Just needs more time and adoption (hello, Google Chrome).
If I understand correctly, wayshot by default save files as
png
and we can save asjpg
extension too. I don't know if this is possible or would be enchantment you wanted in your project, but saving screenshots as JPEG XL (jxl) files would be awesome.Very nice project!