In Operation

cjxl compresses an image or animation to the JPEG XL format. For a target quality, cjxl aims to offer a consistent visual result across different kinds of images, trying to choose sensible defaults.
$ cjxl 019-surfing.png 019-surfing.jxl

The command has used the VarDCT compression algorithm, It’s almost lossless. The PNG image is 54K in size and the output JXL image is 31K.
If you want to change the defaults, delve into the various options. You may wish to change the quality and distance options.

For example, to convert our skiing penguin losslessly, use the -q 100flag. The -q 100 flag is the default for JPEG/GIF.

The output JXL image is 37K, slightly larger than 31K with the lossy defaults.
The corresponding program to cjzl is djxl, a tool which decompresses a JPEG XL image or animation. The output format is determined by the extension of the output file, which can be .png, .jpg, .ppm, .pfm.
Summary
JPEGXL is optimised for responsive web environments. It’s designed to meet the needs of image delivery on the web and professional photography. There’s support for wide colour gamut, high dynamic range and high bit depth images animated images, and embedded previews. It has features aimed at web delivery such as advanced progressive decoding and minimal header overhead, as well as features aimed at image editing and digital printing, such as support for multiple layers, CMYK, and spot colors.
JPEG XL offers significantly better image quality and compression ratios than legacy JPEG.
For more command-line image compression tools, explore our roundup. All free and open source goodness.
Website: github.com/libjxl/libjxl
Support:
Developer: JPEG XL Project Authors
License: BSD 3-Clause “New” or “Revised” License
libjxl is written in C++. Learn C++ with our recommended free books and free tutorials.
Pages in this article:
Page 1 – Introduction and Installation
Page 2 – In Operation and Summary
Related Software
| Console Based Image Compression Tools | |
|---|---|
| MozJPEG | Mozilla JPEG Encoder Project |
| pngquant | Utility and a library for lossy compression of PNG images |
| SVGO | Node.js library and command-line application for optimizing SVG files |
| Oxipng | Multithreaded PNG optimizer, forked from Optipng |
| libjxl | Reference implementation of JPEG XL |
| libjpeg-turbo | JPEG image codec |
| QOI | The Quite OK Image Format |
| YOGA | Yummy Optimizer for Gorgeous Assets |
| pngcrush | Optimizer for PNG files |
| jpegoptim | Optimize JPEG files. Lossless and lossy compression available |
| OptiPNG | Advanced PNG optimizer |
| Guetzli | Perceptual JPEG encoder with excellent compression density at high quality |
| ECT | Fast and effective C++ file optimizer |
| Crunch | Lossy PNG image file optimization |
| zopflipng | PNG optimisation tool using zopfli |
| JPEG Archive | Utilities for archive JPEGs for long term storage |
| optimizt | CLI image optimization tool |
| picopt | Multi format lossless image optimize |
| tinifier | CLI tool for compressing images using the TinyPNG API |
Read our verdict in the software roundup.
Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more. Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form. |

