wanadev / yoga

Converts and optimizes images and 3D models
https://wanadev.github.io/yoga/
Other
99 stars 13 forks source link

JPEG XL support #41

Open flozz opened 2 years ago

flozz commented 2 years ago

See @nekohayo issue on YOGA Image Optimizer → https://github.com/flozz/yoga-image-optimizer/issues/20

nekohayo commented 1 year ago

Here's an example primitive implementation of a batch JPEG XL encoding script in Python: https://github.com/kylxbn/jxl-migrate

It simply calls the cjxl binary with the desired file, and passes -d 0 (mathematically lossless, gives you roughly 15-20% filesize saving when converting existing JPEGs) or -d 1 (visually indistinguishable lossy transcoding, gives you roughly 50 to 90% filesize reduction from a regular JPEG source, according to this man page). cjxl doesn't seem to have a parameter for resizing though, I don't know if that's a problem.

In case this is somehow helpful...

flozz commented 1 year ago

YOGA never call external binaries, it always use libraries directly. It avoid having to write temporary files and it is more reliable to target multiple systems (various Linux distro, Windows,...) :)