gecko-dev/third_party/jpeg-xl
Kagami Sascha Rosylight 0d3b3ecabe Bug 1767432 - Update libjxl to 192ddd r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D145332
2022-05-04 00:22:14 +00:00
..
.github Bug 1767432 - Update libjxl to 192ddd r=tnikkel 2022-05-04 00:22:14 +00:00
cmake Bug 1767432 - Update libjxl to 192ddd r=tnikkel 2022-05-04 00:22:14 +00:00
debian Bug 1767432 - Update libjxl to 192ddd r=tnikkel 2022-05-04 00:22:14 +00:00
docker Bug 1754067 - Update libjxl to 4322679b1c418addc2284c5ea84fc2c3935b4a75; r=saschanaz 2022-02-14 17:57:57 +00:00
examples Bug 1767432 - Update libjxl to 192ddd r=tnikkel 2022-05-04 00:22:14 +00:00
experimental/fast_lossless Bug 1760719 - Update libjxl to 318c592d98b97d103941b90d47107f06a10c71da; r=saschanaz 2022-03-22 10:19:20 +00:00
lib Bug 1767432 - Update libjxl to 192ddd r=tnikkel 2022-05-04 00:22:14 +00:00
plugins Bug 1767432 - Update libjxl to 192ddd r=tnikkel 2022-05-04 00:22:14 +00:00
third_party Bug 1767432 - Update libjxl to 192ddd r=tnikkel 2022-05-04 00:22:14 +00:00
.clang-format Bug 1707590 - Part 1: Add vendored libjxl source r=aosmond 2021-05-06 02:00:55 +00:00
.clang-tidy Bug 1707590 - Part 1: Add vendored libjxl source r=aosmond 2021-05-06 02:00:55 +00:00
.readthedocs.yaml Bug 1731773 - Part 1: Run mach vendor for libjxl and highway r=tnikkel 2021-09-28 10:54:24 +00:00
AUTHORS Bug 1767432 - Update libjxl to 192ddd r=tnikkel 2022-05-04 00:22:14 +00:00
CHANGELOG.md Bug 1767432 - Update libjxl to 192ddd r=tnikkel 2022-05-04 00:22:14 +00:00
CMakeLists.txt Bug 1767432 - Update libjxl to 192ddd r=tnikkel 2022-05-04 00:22:14 +00:00
CODE_OF_CONDUCT.md Bug 1712789 - Update jpeg-xl to bdde644b94c125a15e532b2572b96306371a7d4e r=saschanaz 2021-05-26 08:46:02 +00:00
CONTRIBUTING.md Bug 1731773 - Part 1: Run mach vendor for libjxl and highway r=tnikkel 2021-09-28 10:54:24 +00:00
CONTRIBUTORS Bug 1707590 - Part 1: Add vendored libjxl source r=aosmond 2021-05-06 02:00:55 +00:00
LICENSE Bug 1712789 - Update jpeg-xl to bdde644b94c125a15e532b2572b96306371a7d4e r=saschanaz 2021-05-26 08:46:02 +00:00
PATENTS Bug 1712789 - Update jpeg-xl to bdde644b94c125a15e532b2572b96306371a7d4e r=saschanaz 2021-05-26 08:46:02 +00:00
README.Haiku.md Bug 1731773 - Part 1: Run mach vendor for libjxl and highway r=tnikkel 2021-09-28 10:54:24 +00:00
README.OSX.md Bug 1707590 - Part 1: Add vendored libjxl source r=aosmond 2021-05-06 02:00:55 +00:00
README.md Bug 1754067 - Update libjxl to 4322679b1c418addc2284c5ea84fc2c3935b4a75; r=saschanaz 2022-02-14 17:57:57 +00:00
SECURITY.md Bug 1743793 - Update libjxl and highway r=tnikkel 2021-12-06 23:43:32 +00:00
bash_test.sh Bug 1760719 - Update libjxl to 318c592d98b97d103941b90d47107f06a10c71da; r=saschanaz 2022-03-22 10:19:20 +00:00
ci.sh Bug 1767432 - Update libjxl to 192ddd r=tnikkel 2022-05-04 00:22:14 +00:00
deps.sh Bug 1767432 - Update libjxl to 192ddd r=tnikkel 2022-05-04 00:22:14 +00:00
js-wasm-wrapper.sh Bug 1754067 - Update libjxl to 4322679b1c418addc2284c5ea84fc2c3935b4a75; r=saschanaz 2022-02-14 17:57:57 +00:00

README.md

JPEG XL reference implementation

Build&Test Releases Doc codecov

JXL logo

This repository contains a reference implementation of JPEG XL (encoder and decoder), called libjxl. This software library is used by many applications that support JPEG XL.

JPEG XL is in the final stages of standardization and its codestream and file format are frozen.

The library API, command line options, and tools in this repository are subject to change, however files encoded with cjxl conform to the JPEG XL format specification and can be decoded with current and future djxl decoders or libjxl decoding library.

Quick start guide

For more details and other workflows see the "Advanced guide" below.

Checking out the code

git clone https://github.com/libjxl/libjxl.git --recursive --shallow-submodules

This repository uses git submodules to handle some third party dependencies under third_party, that's why is important to pass --recursive. If you didn't check out with --recursive, or any submodule has changed, run:

git submodule update --init --recursive --depth 1 --recommend-shallow

The --shallow-submodules and --depth 1 --recommend-shallow options create shallow clones which only downloads the commits requested, and is all that is needed to build libjxl. Should full clones be necessary, you could always run:

git submodule foreach git fetch --unshallow
git submodule update --init --recursive

which pulls the rest of the commits in the submodules.

Important: If you downloaded a zip file or tarball from the web interface you won't get the needed submodules and the code will not compile. You can download these external dependencies from source running ./deps.sh. The git workflow described above is recommended instead.

Installing dependencies

Required dependencies for compiling the code, in a Debian/Ubuntu based distribution run:

sudo apt install cmake pkg-config libbrotli-dev libgflags-dev

Optional dependencies for supporting other formats in the cjxl/djxl tools, in a Debian/Ubuntu based distribution run:

sudo apt install libgif-dev libjpeg-dev libopenexr-dev libpng-dev libwebp-dev

We recommend using a recent Clang compiler (version 7 or newer), for that install clang and set CC and CXX variables.

sudo apt install clang
export CC=clang CXX=clang++

Building

cd libjxl
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF ..
cmake --build . -- -j$(nproc)

The encoder/decoder tools will be available in the build/tools directory.

Installing

sudo cmake --install .

Basic encoder/decoder

To encode a source image to JPEG XL with default settings:

build/tools/cjxl input.png output.jxl

For more settings run build/tools/cjxl --help or for a full list of options run build/tools/cjxl -v -v --help.

To decode a JPEG XL file run:

build/tools/djxl input.jxl output.png

When possible cjxl/djxl are able to read/write the following image formats: .exr, .gif, .jpeg/.jpg, .pfm, .pgm/.ppm, .pgx, .png.

Benchmarking

For speed benchmarks on single images in single or multi-threaded decoding djxl can print decoding speed information. See djxl --help for details on the decoding options and note that the output image is optional for benchmarking purposes.

For more comprehensive benchmarking options, see the benchmarking guide.

Advanced guide

Building with Docker

We build a common environment based on Debian/Ubuntu using Docker. Other systems may have different combinations of versions and dependencies that have not been tested and may not work. For those cases we recommend using the Docker container as explained in the step by step guide.

Building JPEG XL for developers

For experienced developers, we provide build instructions for several other environments:

If you encounter any difficulties, please use Docker instead.

License

This software is available under a 3-clause BSD license which can be found in the LICENSE file, with an "Additional IP Rights Grant" as outlined in the PATENTS file.

Please note that the PATENTS file only mentions Google since Google is the legal entity receiving the Contributor License Agreements (CLA) from all contributors to the JPEG XL Project, including the initial main contributors to the JPEG XL format: Cloudinary and Google.

Additional documentation

Codec description

Development process

Contact

If you encounter a bug or other issue with the software, please open an Issue here.

There is a subreddit about JPEG XL, and informal chatting with developers and early adopters of libjxl can be done on the JPEG XL Discord server.