• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..31-Mar-2022-

debian/H07-May-2022-410351

docker/H31-Mar-2022-944639

examples/H03-May-2022-761606

lib/H03-May-2022-93,13971,022

plugins/H03-May-2022-927741

third_party/H03-May-2022-501363

.clang-formatH A D31-Mar-202293 54

.clang-tidyH A D31-Mar-20222.6 KiB7165

AUTHORSH A D31-Mar-2022539 2118

CODE_OF_CONDUCT.mdH A D31-Mar-20224.4 KiB9473

CONTRIBUTING.mdH A D31-Mar-20225.4 KiB11684

CONTRIBUTORSH A D31-Mar-2022672 2423

LICENSEH A D31-Mar-20221.5 KiB2822

PATENTSH A D31-Mar-20221.3 KiB2320

README.Haiku.mdH A D31-Mar-2022768 2114

README.OSX.mdH A D31-Mar-20221.2 KiB4129

README.mdH A D31-Mar-20228.8 KiB231170

SECURITY.mdH A D31-Mar-20221.8 KiB3829

bash_test.shH A D31-Mar-20226.5 KiB229180

ci.shH A D31-Mar-202243.6 KiB1,3391,038

deps.shH A D31-Mar-20222.3 KiB8152

js-wasm-wrapper.shH A D31-Mar-2022717 204

README.Haiku.md

1## Disclaimer
2
3Haiku builds are not officially supported, i.e. the build might not work at all,
4some tests may fail and some sub-projects are excluded from build.
5
6This manual outlines Haiku-specific setup. For general building and testing
7instructions see "[README](README.md)" and
8"[Building and Testing changes](doc/building_and_testing.md)".
9
10## Dependencies
11
12```shell
13pkgman install llvm9_clang ninja cmake doxygen libjpeg_turbo_devel
14```
15
16## Building
17
18```shell
19TEST_STACK_LIMIT=none CMAKE_FLAGS="-I/boot/system/develop/tools/lib/gcc/x86_64-unknown-haiku/8.3.0/include/c++ -I/boot/system/develop/tools/lib/gcc/x86_64-unknown-haiku/8.3.0/include/c++/x86_64-unknown-haiku" CMAKE_SHARED_LINKER_FLAGS="-shared -Xlinker -soname=libjpegxl.so -lpthread" ./ci.sh opt
20```
21

README.OSX.md

1## Disclaimer
2
3OSX builds have "best effort" support, i.e. build might not work at all, some
4tests may fail and some sub-projects are excluded from build.
5
6This manual outlines OSX specific setup. For general building and testing
7instructions see "[README](README.md)" and
8"[Building and Testing changes](doc/building_and_testing.md)".
9
10[Homebrew](https://brew.sh/) is a popular package manager. JPEG XL library and
11binaries could be installed using it:
12
13```bash
14brew install jpeg-xl
15```
16
17## Dependencies
18
19Make sure that `brew doctor` does not report serious problems and up-to-date
20version of XCode is installed.
21
22Installing (actually, building) `clang` might take a couple hours.
23
24```bash
25brew install llvm
26```
27
28```bash
29brew install coreutils cmake giflib jpeg-turbo libpng ninja zlib
30```
31
32Before building the project check that `which clang` is
33`/usr/local/opt/llvm/bin/clang`, not the one provided by XCode. If not, update
34`PATH` environment variable.
35
36Also, setting `CMAKE_PREFIX_PATH` might be necessary for correct include paths
37resolving, e.g.:
38
39```bash
40export CMAKE_PREFIX_PATH=`brew --prefix giflib`:`brew --prefix jpeg-turbo`:`brew --prefix libpng`:`brew --prefix zlib`
41```

README.md

1# JPEG XL reference implementation
2
3<img src="doc/jxl.svg" width="100" align="right" alt="JXL logo">
4
5This repository contains a reference implementation of JPEG XL (encoder and
6decoder), called `libjxl`.
7
8JPEG XL is in the final stages of standardization and its codestream format is
9frozen.
10
11The libraries API, command line options and tools in this repository are subject
12to change, however files encoded with `cjxl` conform to the JPEG XL format
13specification and can be decoded with current and future `djxl` decoders or
14`libjxl` decoding library.
15
16## Quick start guide
17
18For more details and other workflows see the "Advanced guide" below.
19
20### Checking out the code
21
22```bash
23git clone https://gitlab.com/wg1/jpeg-xl.git --recursive
24```
25
26This repository uses git submodules to handle some third party dependencies
27under `third_party/`, that's why is important to pass `--recursive`. If you
28didn't check out with `--recursive`, or any submodule has changed, run:
29`git submodule update --init --recursive`.
30
31Important: If you downloaded a zip file or tarball from the web interface you
32won't get the needed submodules and the code will not compile. You can download
33these external dependencies from source running `./deps.sh`. The git workflow
34described above is recommended instead.
35
36### Installing dependencies
37
38Required dependencies for compiling the code, in a Debian/Ubuntu based
39distribution run:
40
41```bash
42sudo apt install cmake pkg-config libbrotli-dev
43```
44
45Optional dependencies for supporting other formats in the `cjxl`/`djxl` tools,
46in a Debian/Ubuntu based distribution run:
47
48```bash
49sudo apt install libgif-dev libjpeg-dev libopenexr-dev libpng-dev libwebp-dev
50```
51
52We recommend using a recent Clang compiler (version 7 or newer), for that
53install clang and set `CC` and `CXX` variables. For example, with clang-7:
54
55```bash
56sudo apt install clang-7
57export CC=clang-7 CXX=clang++-7
58```
59
60### Building
61
62```bash
63cd jpeg-xl
64mkdir build
65cd build
66cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF ..
67cmake --build . -- -j$(nproc)
68```
69
70The encoder/decoder tools will be available in the `build/tools` directory.
71
72### <a name="installing"></a> Installing
73
74```bash
75sudo cmake --install .
76```
77
78### Basic encoder/decoder
79
80To encode a source image to JPEG XL with default settings:
81
82```bash
83build/tools/cjxl input.png output.jxl
84```
85
86For more settings run `build/tools/cjxl --help` or for a full list of options
87run `build/tools/cjxl -v -v --help`.
88
89To decode a JPEG XL file run:
90
91```bash
92build/tools/djxl input.jxl output.png
93```
94
95When possible `cjxl`/`djxl` are able to read/write the following
96image formats: .exr, .gif, .jpeg/.jpg, .pfm, .pgm/.ppm, .pgx, .png.
97
98### Benchmarking
99
100For speed benchmarks on single images in single or multi-threaded decoding
101`djxl` can print decoding speed information. See `djxl --help` for details
102on the decoding options and note that the output image is optional for
103benchmarking purposes.
104
105For a more comprehensive comparison of compression density between multiple
106options see "Benchmarking with benchmark_xl" section below.
107
108## Advanced guide
109
110### Building with Docker
111
112We build a common environment based on Debian/Ubuntu using Docker. Other
113systems may have different combinations of versions and dependencies that
114have not been tested and may not work. For those cases we recommend using the
115Docker environment as explained in the
116[step by step guide](doc/developing_in_docker.md).
117
118### Building JPEG XL for developers
119
120For experienced developers, we also provide build instructions for an [up to
121date Debian-based Linux](doc/developing_in_debian.md) and [64-bit
122Windows](doc/developing_in_windows.md). If you encounter any difficulties,
123please use Docker instead.
124
125## Benchmarking with benchmark_xl
126
127We recommend `build/tools/benchmark_xl` as a convenient method for reading
128images or image sequences, encoding them using various codecs (jpeg jxl png
129webp), decoding the result, and computing objective quality metrics. An example
130invocation is:
131
132```bash
133build/tools/benchmark_xl --input "/path/*.png" --codec jxl:wombat:d1,jxl:cheetah:d2
134```
135
136Multiple comma-separated codecs are allowed. The characters after : are
137parameters for the codec, separated by colons, in this case specifying maximum
138target psychovisual distances of 1 and 2 (higher implies lower quality) and
139the encoder effort (see below). Other common parameters are `r0.5` (target
140bitrate 0.5 bits per pixel) and `q92` (quality 92, on a scale of 0-100, where
141higher is better). The `jxl` codec supports the following additional parameters:
142
143Speed: `falcon`, `cheetah`, `hare`, `wombat`, `squirrel`, `kitten`, `tortoise`
144control the encoder effort in ascending order. This also affects memory usage:
145using lower effort will typically reduce memory consumption during encoding.
146
147*   `falcon` disables all of the following tools.
148*   `cheetah` enables coefficient reordering, context clustering, and heuristics
149    for selecting DCT sizes and quantization steps.
150*   `hare` enables Gaborish filtering, chroma from luma, and an initial estimate
151    of quantization steps.
152*   `wombat` enables error diffusion quantization and full DCT size selection
153    heuristics.
154*   `squirrel` (default) enables dots, patches, and spline detection, and full
155    context clustering.
156*   `kitten` optimizes the adaptive quantization for a psychovisual metric.
157*   `tortoise` enables a more thorough adaptive quantization search.
158
159Mode: JPEG XL has two modes. The default is Var-DCT mode, which is suitable for
160lossy compression. The other mode is Modular mode, which is suitable for lossless
161compression. Modular mode can also do lossy compression (e.g. `jxl:m:q50`).
162
163*   `m` activates modular mode.
164
165Other arguments to benchmark_xl include:
166
167*   `--save_compressed`: save codestreams to `output_dir`.
168*   `--save_decompressed`: save decompressed outputs to `output_dir`.
169*   `--output_extension`: selects the format used to output decoded images.
170*   `--num_threads`: number of codec instances that will independently
171    encode/decode images, or 0.
172*   `--inner_threads`: how many threads each instance should use for parallel
173    encoding/decoding, or 0.
174*   `--encode_reps`/`--decode_reps`: how many times to repeat encoding/decoding
175    each image, for more consistent measurements (we recommend 10).
176
177The benchmark output begins with a header:
178
179```
180Compr              Input    Compr            Compr       Compr  Decomp  Butteraugli
181Method            Pixels     Size              BPP   #    MP/s    MP/s     Distance    Error p norm           BPP*pnorm   Errors
182```
183
184`ComprMethod` lists each each comma-separated codec. `InputPixels` is the number
185of pixels in the input image. `ComprSize` is the codestream size in bytes and
186`ComprBPP` the bitrate. `Compr MP/s` and `Decomp MP/s` are the
187compress/decompress throughput, in units of Megapixels/second.
188`Butteraugli Distance` indicates the maximum psychovisual error in the decoded
189image (larger is worse). `Error p norm` is a similar summary of the psychovisual
190error, but closer to an average, giving less weight to small low-quality
191regions. `BPP*pnorm` is the product of `ComprBPP` and `Error p norm`, which is a
192figure of merit for the codec (lower is better). `Errors` is nonzero if errors
193occurred while loading or encoding/decoding the image.
194
195## License
196
197This software is available under a 3-clause BSD license which can be found in
198the [LICENSE](LICENSE) file, with an "Additional IP Rights Grant" as outlined in
199the [PATENTS](PATENTS) file.
200
201Please note that the PATENTS file only mentions Google since Google is the legal
202entity receiving the Contributor License Agreements (CLA) from all contributors
203to the JPEG XL Project, including the initial main contributors to the JPEG XL
204format: Cloudinary and Google.
205
206## Additional documentation
207
208### Codec description
209
210*   [Introductory paper](https://www.spiedigitallibrary.org/proceedings/Download?fullDOI=10.1117%2F12.2529237) (open-access)
211*   [XL Overview](doc/xl_overview.md) - a brief introduction to the source code modules
212*   [JPEG XL white paper](http://ds.jpeg.org/whitepapers/jpeg-xl-whitepaper.pdf)
213*   [JPEG XL website](https://jpeg.org/jpegxl/)
214*   [Jon's JXL info page](https://sneyers.info/jxl/)
215
216### Development process
217*   [Docker setup - **start here**](doc/developing_in_docker.md)
218*   [Building on Debian](doc/developing_in_debian.md) - for experts only
219*   [Building on Windows](doc/developing_in_windows.md) - for experts only
220*   [More information on testing/build options](doc/building_and_testing.md)
221*   [Git guide for JPEG XL](doc/developing_in_github.md) - for developers only
222*   [Building Web Assembly artifacts](doc/building_wasm.md)
223
224### Contact
225
226If you encounter a bug or other issue with the software, please open an Issue here.
227
228There is a [subreddit about JPEG XL](https://www.reddit.com/r/jpegxl/), and
229informal chatting with developers and early adopters of `libjxl` can be done on the
230[JPEG XL Discord server](https://discord.gg/DqkQgDRTFu).
231