[
  {
    "tool": "cjxl",
    "args": [
      "--version"
    ],
    "status": 0,
    "stdout": "cjxl v0.12.0 0.12.0 [_NEON_] {AppleClang 21.0.0.21000334}\nCopyright (c) the JPEG XL Project\n",
    "stderr": ""
  },
  {
    "tool": "djxl",
    "args": [
      "--version"
    ],
    "status": 0,
    "stdout": "djxl v0.12.0 0.12.0 [_NEON_] {AppleClang 21.0.0.21000334}\nCopyright (c) the JPEG XL Project\n",
    "stderr": ""
  },
  {
    "tool": "cjxl",
    "args": [
      "--help",
      "-v"
    ],
    "status": 0,
    "stdout": "Usage: /opt/homebrew/bin/cjxl INPUT OUTPUT [OPTIONS...]\n INPUT\n    the input can be JXL, PPM, PNM, PFM, PAM, PGX, PNG, APNG, GIF, JPEG, EXR\n OUTPUT\n    the compressed JXL output file\n\nBasic options:\n -d DISTANCE, --distance=DISTANCE\n    Target visual distance in JND units, range: 0.0 .. 25.0.\n    0.0 = mathematically lossless, default for JPEG/GIF input.\n    1.0 = visually lossless, default for other input.\n    Recommended range: 0.5 .. 3.0. Higher values allow more distortion.\nMutually exclusive with --quality.\n -q QUALITY, --quality=QUALITY\n    Internally mapped to --distance, range: 0 .. 100.\n    100 = mathematically lossless. 90 = visually lossless.\n    Quality values roughly match libjpeg quality.\n    Recommended range: 68 .. 96. Mutually exclusive with --distance.\n -e EFFORT, --effort=EFFORT\n    Encoder effort, range: 1 .. 10, default = 7.\n    Higher values allow more computation, generally achieving smaller output at same quality.\n    For lossy encoding, higher effort should achieve more accurate quality.\n -V, --version\n    Print encoder library version number and exit.\n --quiet\n    Minimal printing.\n -v, --verbose\n    Verbose printing; can be repeated and also applies to help (!).\n\nAdvanced options:\n -a DISTANCE, --alpha_distance=DISTANCE\n    Target visual distance for the alpha channel, range: 0.0 .. 25.0, default = 0.0.\n    0.0 = mathematically lossless. 1.0 = visually lossless.\n    Recommended range: 0.5 .. 3.0.\n -p, --progressive\n    More progressive/responsive decoding.\n --group_order=0|1\n    Order in which groups are stored in the codestream for progressive rendering, default = 0.\n    0 = scanline order. 1 = center-first order.\n --container=0|1\n    0 = do not use the container format unless it is needed.\n    1 = use the container format even if it is not needed.\n --compress_boxes=0|1\n    Disable/enable Brotli compression for metadata boxes, default = 1. 0 = disable. 1 = enable.\n --brotli_effort=EFFORT\n    Brotli effort, range: 0 .. 11, default = 9.\n    Higher values allow more computation targeting higher density.\n -m 0|1, --modular=0|1\n    0 = use VarDCT mode. 1 = use modular mode. Default = encoder chooses.\n -j 0|1, --lossless_jpeg=0|1\n    0 = decode JPEG input to pixels and reencode. 1 = losslessly transcode JPEG data. Default = 1.\n --num_threads=THREADS\n    Number of worker threads, default = -1.\n    -1 = use machine default. 0 = do not use multithreading.\n --photon_noise_iso=ISO_FILM_SPEED\n    Add noise to the image emulating photographic film or sensor noise, default = 0.\n    Higher values add more noise, e.g. 100 gives a low amount of noise, 3200 gives a lot of noise.\n --intensity_target=NITS\n    Upper bound on the intensity level present in the image, in nits.\n    0 = choose a sensible value based on the color encoding. Default = 0.\n -x key=value, --dec-hints=key=value\n    Use with 'raw' formats like PPM which do not store colorspace information\n    and metadata, or to strip or modify metadata from formats that do.\n    The key 'color_space' indicates an enumerated ColorEncoding, for example:\n      -x color_space=RGB_D65_SRG_Per_SRG is sRGB with perceptual rendering intent\n      -x color_space=RGB_D65_202_Rel_PeQ is Rec.2100 PQ with relative rendering intent\n    Shorthands: sRGB, DisplayP3, Adobe98, ProPhoto, Rec2100PQ, Rec2100HLG\n    The key 'icc_pathname' refers to a binary file containing an ICC profile.\n    The keys 'exif', 'xmp', and 'jumbf' refer to a binary file containing metadata;\n    existing metadata of the same type will be overwritten.\n    Specific metadata can be stripped using e.g. -x strip=exif.\n    Stripping metadata with lossless JPEG recompression won't allow reconstruction,\n    hence `--allow_jpeg_reconstruction=0` must be passed in this case.\n --buffering=-1..3\n    Controls how much input buffering libjxl uses, affecting memory usage and compression quality.\n    -1 = encoder chooses (default). 0 = buffer entire image (most memory, best compression).\n    1 = stream input for large images. 2 = stream input with a lower threshold.\n    3 = deprecated; use --output_mode to control output streaming.\n\n -h, --help\n    Prints this help message. Add -v (up to a total of 4 times) to see more options.\n",
    "stderr": "JPEG XL encoder v0.12.0 0.12.0 [_NEON_] {AppleClang 21.0.0.21000334}\n"
  },
  {
    "tool": "djxl",
    "args": [
      "--help",
      "-v"
    ],
    "status": 0,
    "stdout": "Usage: /opt/homebrew/bin/djxl INPUT OUTPUT [OPTIONS...]\n INPUT\n    The compressed input file (JXL). Use '-' for input from stdin.\n OUTPUT\n    The output format can be PPM, PNM, PFM, PAM, PGX, PNG, APNG, JPEG, EXR\n    To extract metadata, use output format EXIF, XMP, or JUMBF.\n    The format is selected based on extension ('filename.png') or can be overwritten by using --output_format.\n    Use '-' for output to stdout (e.g. '- --output_format ppm')\n\nBasic options:\n --output_format=OUTPUT_FORMAT_DESC\n    Set the output format. This overrides the output format detected from a potential file extension in the OUTPUT filename.\nMust be one of png, apng, jpg, jpeg, npy, pgx, pam, pgm, ppm, pnm, pfm, exr, exif, xmp, xml, jumb, jumbf when converted to lower case.\n -V, --version\n    Print version number and exit.\n --quiet\n    Silence output (except for errors).\n -v, --verbose\n    Verbose output; can be repeated and also applies to help (!).\n\nAdvanced options:\n --num_threads=N\n    Number of worker threads (-1 == use machine default, 0 == do not use multithreading).\n --bits_per_sample=N\n    Sets the output bit depth. The value 0 (default for PNM) means the original (input) bit depth.\n    The value -1 (default for other codecs) means it depends on the output format capabilities\n    and the input bit depth (e.g. decoding a 12-bit image to PNG will produce a 16-bit PNG).\n --display_nits=N\n    If set to a non-zero value, tone maps the image the given peak display luminance.\n --color_space=COLORSPACE_DESC\n    Sets the desired output color space of the image. For example:\n      --color_space=RGB_D65_SRG_Per_SRG is sRGB with perceptual rendering intent\n      --color_space=RGB_D65_202_Rel_PeQ is Rec.2100 PQ with relative rendering intent\n -s 1|2|4|8, --downsampling=1|2|4|8\n    If the input JXL stream contains hints for target downsampling ratios,\n    only decode what is needed to produce an image intended for this downsampling ratio.\n --allow_partial_files\n    Allow decoding of truncated files.\n -j, --pixels_to_jpeg\n    By default, if the input JXL is a recompressed JPEG file, djxl reconstructs that JPEG file.\n    This flag causes the decoder to instead decode to pixels and encode a new (lossy) JPEG.\n -J, --reconstruct_jpeg\n    Losslessly reconstruct a JPEG if possible, and fail otherwise.\n -q N, --jpeg_quality=N\n    Sets the JPEG output quality, default is 95. Setting this option implies --pixels_to_jpeg.\n\n -h, --help\n    Prints this help message. Add -v (up to a total of 2 times) to see more options.\n",
    "stderr": "JPEG XL decoder v0.12.0 0.12.0 [_NEON_] {AppleClang 21.0.0.21000334}\n"
  },
  {
    "tool": "cjxl",
    "args": [
      "source.png",
      "lossless.jxl",
      "-d",
      "0",
      "-e",
      "7"
    ],
    "status": 0,
    "stdout": "",
    "stderr": "JPEG XL encoder v0.12.0 0.12.0 [_NEON_] {AppleClang 21.0.0.21000334}\nEncoding [Modular, lossless, effort: 7]\nCompressed to 252.0 kB (2.100 bpp).\n1200 x 800, 7.206 MP/s, 10 threads.\n"
  },
  {
    "tool": "djxl",
    "args": [
      "lossless.jxl",
      "lossless.png"
    ],
    "status": 0,
    "stdout": "",
    "stderr": "JPEG XL decoder v0.12.0 0.12.0 [_NEON_] {AppleClang 21.0.0.21000334}\nDecoded to pixels.\n1200 x 800, 38.404 MP/s, 10 threads.\n"
  },
  {
    "tool": "cjxl",
    "args": [
      "source.png",
      "distance-1.jxl",
      "-d",
      "1",
      "-e",
      "7"
    ],
    "status": 0,
    "stdout": "",
    "stderr": "JPEG XL encoder v0.12.0 0.12.0 [_NEON_] {AppleClang 21.0.0.21000334}\nEncoding [VarDCT, d1.000, effort: 7]\nCompressed to 93706 bytes (0.781 bpp).\n1200 x 800, 8.092 MP/s, 10 threads.\n"
  },
  {
    "tool": "djxl",
    "args": [
      "distance-1.jxl",
      "distance-1.png"
    ],
    "status": 0,
    "stdout": "",
    "stderr": "JPEG XL decoder v0.12.0 0.12.0 [_NEON_] {AppleClang 21.0.0.21000334}\nDecoded to pixels.\n1200 x 800, 123.344 MP/s, 10 threads.\n"
  },
  {
    "tool": "cjxl",
    "args": [
      "source.png",
      "distance-4.jxl",
      "-d",
      "4",
      "-e",
      "7"
    ],
    "status": 0,
    "stdout": "",
    "stderr": "JPEG XL encoder v0.12.0 0.12.0 [_NEON_] {AppleClang 21.0.0.21000334}\nEncoding [VarDCT, d4.000, effort: 7]\nCompressed to 41411 bytes (0.345 bpp).\n1200 x 800, 5.543 MP/s, 10 threads.\n"
  },
  {
    "tool": "djxl",
    "args": [
      "distance-4.jxl",
      "distance-4.png"
    ],
    "status": 0,
    "stdout": "",
    "stderr": "JPEG XL decoder v0.12.0 0.12.0 [_NEON_] {AppleClang 21.0.0.21000334}\nDecoded to pixels.\n1200 x 800, 66.393 MP/s, 10 threads.\n"
  },
  {
    "tool": "cjxl",
    "args": [
      "source.jpg",
      "jpeg-preserved.jxl",
      "--lossless_jpeg=1",
      "-e",
      "7"
    ],
    "status": 0,
    "stdout": "",
    "stderr": "JPEG XL encoder v0.12.0 0.12.0 [_NEON_] {AppleClang 21.0.0.21000334}\nEncoding [JPEG, lossless transcode, effort: 7]\nCompressed to 92291 bytes including container \n"
  },
  {
    "tool": "djxl",
    "args": [
      "jpeg-preserved.jxl",
      "restored.jpg",
      "--reconstruct_jpeg"
    ],
    "status": 0,
    "stdout": "",
    "stderr": "JPEG XL decoder v0.12.0 0.12.0 [_NEON_] {AppleClang 21.0.0.21000334}\nReconstructed to JPEG.\n1200 x 800, 89.624 MP/s, 12.451 MB/s, 10 threads.\n"
  },
  {
    "tool": "djxl",
    "args": [
      "jpeg-preserved.jxl",
      "quality-100.jpg",
      "--pixels_to_jpeg",
      "--jpeg_quality=100"
    ],
    "status": 0,
    "stdout": "",
    "stderr": "JPEG XL decoder v0.12.0 0.12.0 [_NEON_] {AppleClang 21.0.0.21000334}\nDecoded to pixels.\n1200 x 800, 173.924 MP/s, 10 threads.\n"
  },
  {
    "tool": "djxl",
    "args": [
      "lossless.jxl",
      "cannot-restore.jpg",
      "--reconstruct_jpeg"
    ],
    "status": 1,
    "stdout": "",
    "stderr": "JPEG XL decoder v0.12.0 0.12.0 [_NEON_] {AppleClang 21.0.0.21000334}\nError: could not decode losslessly to JPEG.\n"
  }
]