Open flozz opened 2 years 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...
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,...) :)
See @nekohayo issue on YOGA Image Optimizer → https://github.com/flozz/yoga-image-optimizer/issues/20