Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
FREEDOM251

Freedom251 › Blog › ImageMagick

How to Convert JPEG XL (JXL) Images to JPG, PNG, or WebP

By Freedom251 Team · · 10 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The most reliable local method is the official libjxl command-line tool. Install it with apt install libjxl-tools on Debian-based Linux or brew install jpeg-xl on macOS, then run djxl input.jxl output.png, djxl input.jxl output.jpg, or the equivalent filename with the format you need. The output extension tells djxl which supported format to write.

Use JPG for broad compatibility and small files, PNG when you need lossless pixels or transparency, and WebP when the receiving application accepts it. WebP is not a direct djxl output in the documented manual, so convert through an ImageMagick build that has JPEG XL support enabled.

As an Amazon Associate I earn from qualifying purchases.

Choose the output format before converting

JPEG XL files use the .jxl extension and can contain either an ordinary JPEG XL image or a JPEG that was losslessly recompressed into JPEG XL. Your target format affects compatibility, transparency, animation handling, and whether another lossy compression step occurs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Target Command or tool Best for Important limitation
JPG/JPEG djxl input.jxl output.jpg Websites, office software, and devices that expect JPEG A newly encoded JPEG is lossy. Bit-for-bit recovery is possible only when the JXL contains a losslessly recompressed JPEG and djxl reconstructs it.
PNG djxl input.jxl output.png Lossless pixels, screenshots, diagrams, and transparency Files can be considerably larger than JPG or WebP for photographic images.
WebP magick input.jxl output.webp Applications and sites that accept WebP Requires an ImageMagick build with JPEG XL and WebP delegates enabled; support varies by package.

If you do not know what the recipient accepts, PNG is the safest choice for preserving image data and alpha transparency. If the recipient specifically requests JPEG, use the JPG procedure below and decide whether preserving the original JPEG stream or creating a new JPEG is appropriate.

Install the official JPEG XL tools

Debian-based Linux

Open a terminal and install the distribution package:

sudo apt update
sudo apt install libjxl-tools

The package supplies the djxl decoder used in the conversion commands. Package versions and available features can differ between distributions, so use the package manager’s normal update process and read any installation errors it reports.

macOS with Homebrew

In Terminal, install the JPEG XL package:

brew install jpeg-xl

Homebrew places the command-line tools on the path used by your shell in a standard installation. If your shell cannot find djxl afterward, reopen the terminal or check that Homebrew’s binary directory is included in your PATH.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Windows and other systems

The commands in this guide are the reference workflow for Linux and macOS. On another operating system, obtain a build of the official libjxl tools or use an image application that explicitly lists JPEG XL input support. The exact installer and command location depend on the package you choose; do not assume that a file named djxl is present just because another image program is installed.

Convert a JXL file to JPG

Basic conversion

Change into the directory containing the source image and run:

djxl input.jxl output.jpg

The documented djxl behavior uses the output filename extension to select the format. Use .jpeg instead of .jpg if that is the naming convention required by your application; both identify the JPEG family.

When the conversion can be lossless

JPEG XL can losslessly recompress an existing JPEG. When the JXL contains that type of data, writing a .jpg file with the default command reconstructs the original JPEG. In that specific case, the resulting JPEG can be preserved bit-for-bit rather than being decoded and compressed again.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not describe every JXL-to-JPG conversion as lossless. A normal JXL image does not contain an original JPEG stream to recover, and a newly encoded JPEG introduces JPEG’s lossy compression. The file’s creation history determines which case applies.

Create a new JPEG from decoded pixels

If you want djxl to decode the JXL and then encode a new JPEG, explicitly request pixel-to-JPEG conversion:

djxl --pixels_to_jpeg input.jxl output.jpg

Set the new JPEG’s quality with --jpeg_quality:

djxl --pixels_to_jpeg --jpeg_quality YOUR_VALUE input.jxl output.jpg

Replace YOUR_VALUE with the quality value appropriate for your workflow. The right setting depends on the image and the acceptable file size; inspect the result rather than assuming that a particular number guarantees a visual outcome. This mode is useful when you need a freshly encoded JPEG even if the source JXL originated from a JPEG.

Check the JPG before deleting the source

  1. Run the conversion in a separate output directory or use a new filename.
  2. Open the JPG in the application that will receive it.
  3. Check that the dimensions, crop, colors, and any important fine detail look correct.
  4. If the source has transparency, confirm how the JPG’s opaque background appears. JPEG does not carry an alpha channel.
  5. Keep the original .jxl until the destination application has accepted the converted file.

Convert a JXL file to PNG

Single-image conversion

PNG is a direct output of djxl:

djxl input.jxl output.png

This is the appropriate target when you need lossless decoded pixels or transparency. It is commonly the safer interchange format for screenshots, interface captures, diagrams, logos, and other images where an additional lossy encode would be undesirable.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Understand the size trade-off

PNG uses lossless compression, so it generally retains all decoded pixel values, but that does not mean it will be the smallest file. Photographs and other complex images often occupy more space as PNG than as a lossy JPG or WebP. Choose PNG for fidelity and alpha support, not simply because the extension is familiar.

Validate transparency

  1. Convert with the command above.
  2. Open the PNG against a contrasting background in an editor or viewer that displays transparency.
  3. Check that transparent areas remain transparent and that edges around semi-transparent objects look correct.
  4. Save or upload the PNG only after the receiving application has successfully opened it.

If the source image is animated, do not assume that one PNG contains the complete animation. Follow the animated-file procedure below and inspect every generated frame.

Convert a JXL file to WebP

Why WebP uses a different tool

The documented djxl manual lists PNG, JPG, PPM, and PFM output extensions, but not WebP. Use a general image library for WebP conversion. ImageMagick’s support index lists JPEG XL support beginning with version 7.0.10-54, provided the particular build includes the required delegate.

Check ImageMagick before converting

Run this command:

magick -list format | grep -E 'JXL|WEBP'

You should see entries for both JXL input and WebP output. The exact text and capability flags depend on the package. If JXL is absent, that magick binary cannot decode your source; install or select a build with JPEG XL support instead of repeatedly retrying the conversion.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run the conversion

magick input.jxl output.webp

ImageMagick selects the output format from .webp. Open the result in the target site or application and verify that it accepts the chosen WebP variant. Support for JPEG XL input and WebP output is a property of the installed build, not a guarantee shared by every ImageMagick package.

Diagnose common WebP failures

  • “No decode delegate” or an equivalent JXL error: repeat the format-list check. Install a package whose ImageMagick build includes JPEG XL support.
  • JXL appears but WebP does not: the build can read the source but lacks WebP writing support. Use another image build that provides both delegates.
  • The command succeeds but the destination rejects the file: open the WebP locally, confirm that it is not zero bytes, and test it in the exact browser, editor, or upload service that will use it.
  • Unexpected transparency or color: compare the WebP with the PNG conversion. If transparency is essential, retain the PNG as a reference and verify how the receiving application renders alpha.

Convert multiple JXL files in a folder

Batch conversion to PNG on Linux or macOS

After testing one file, a shell loop can convert every lowercase .jxl file in the current directory:

mkdir -p png-output
for f in ./*.jxl; do
  [ -e "$f" ] || continue
  djxl "$f" "png-output/$(basename "${f%.jxl}").png"
done

The loop keeps the source files and writes matching base names into png-output. Test it in a copy of the folder first, especially when filenames contain unusual characters or when files may already have the same output names.

Batch conversion to JPG

mkdir -p jpg-output
for f in ./*.jxl; do
  [ -e "$f" ] || continue
  djxl "$f" "jpg-output/$(basename "${f%.jxl}").jpg"
done

This uses the default JPG behavior, including original-JPEG reconstruction when that is available. To force new JPEG encoding, add --pixels_to_jpeg and, if needed, --jpeg_quality to the djxl line after testing the result on representative images.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Batch conversion to WebP

mkdir -p webp-output
for f in ./*.jxl; do
  [ -e "$f" ] || continue
  magick "$f" "webp-output/$(basename "${f%.jxl}").webp"
done

Run the magick -list format check before starting a batch. A missing delegate will otherwise cause every file to fail for the same reason.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Handle animated JPEG XL files

A JXL file can contain multiple frames. The djxl manual states that animated input produces multiple output files with frame-number suffixes. For example, converting an animated source to PNG may create a sequence of numbered PNG files rather than a single animated PNG.

  1. Make a dedicated output directory so generated frame files cannot overwrite unrelated images.
  2. Run the conversion with the desired extension, such as djxl animation.jxl frames/frame.png.
  3. List the output files and confirm how the tool named each frame.
  4. Open several frames, including the first and last, to check dimensions, transparency, and timing-independent visual content.
  5. If the destination requires an animation, confirm that it accepts the resulting frame sequence or use a separate animation-authoring step appropriate to that destination.

Do not promise that converting an animated JXL to a single JPG or PNG preserves animation. JPG is a still-image format, and the documented djxl behavior for multi-frame input is to emit separate files.

Choose between JPG, PNG, and WebP

Use JPG when compatibility is the priority

JPG is widely accepted by older software, document systems, and upload forms. It is a practical choice for photographs when some loss is acceptable and transparency is not required. If the JXL came from a losslessly recompressed JPEG, use the default djxl JPG path so the original JPEG can be reconstructed instead of encoding it again.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use PNG when pixels or alpha matter

PNG is the appropriate target for exact decoded pixels and transparent backgrounds. It is usually the clearest handoff format for graphics work, screenshots, diagrams, and assets that will be edited again. Its lossless nature does not guarantee a small file.

Use WebP when the recipient supports it

WebP can be useful when a site or application explicitly accepts it. Because WebP conversion goes through a general image tool, verify both input and output delegates in the installed ImageMagick build. The receiving application, rather than the filename alone, should determine whether WebP is a suitable final format.

Question JPG PNG WebP
Can it preserve transparency? No alpha channel Yes Depends on the WebP file and receiving application
Is a new encode lossy? Yes, when creating JPEG from pixels No, PNG compression is lossless Depends on the WebP encoding mode selected by the tool
Directly documented by djxl? Yes Yes No; use a general image library
Primary decision Maximum legacy compatibility Pixel fidelity and alpha Recipient accepts WebP and the local build supports both formats

Compatibility before sharing the converted file

JPEG XL adoption differs among browsers and applications. The libjxl support index lists Safari support from version 17 and ImageMagick support from version 7.0.10-54, while also documenting support in several online tools. Those entries describe listed support, not a guarantee that every device, browser configuration, or packaged build behaves identically.

Before distributing a JXL, test it in the actual browser or editor your audience uses. If the recipient cannot open JXL, convert to the requested legacy format and retain the original for future editing or re-export. JPEG XL was standardized in 2022 as ISO/IEC 18181, but standardization does not by itself make every application a reader.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshooting checklist

djxl is not found

  • Confirm that libjxl-tools was installed on Debian-based Linux or jpeg-xl through Homebrew on macOS.
  • Open a new terminal so the updated command path is loaded.
  • If you installed a nonstandard build, call the executable by its full path or add its directory to PATH.

The source cannot be decoded

  • Check that the filename is really a JXL file and that the copy is complete.
  • Try opening the original in another JPEG XL-capable application to distinguish a damaged file from a missing decoder.
  • Do not rename a different image format to .jxl; the extension alone cannot convert its contents.

The output has the wrong format

  • Check the output extension. djxl uses the extension to select a documented output format.
  • For WebP, use magick with an explicit .webp filename and verify the delegate list first.
  • Open the result and inspect its file information in the destination application rather than trusting the name alone.

The result looks different

  • Determine whether you created a new lossy JPEG with --pixels_to_jpeg.
  • Compare the JPG with a PNG conversion to separate JPEG compression changes from decoding or color-management differences.
  • For a source that was originally JPEG, use the default djxl input.jxl output.jpg path when you want possible bit-for-bit JPEG reconstruction.

The destination still rejects the file

  1. Open the converted file locally.
  2. Check that its size is nonzero and that the image displays completely.
  3. Try the alternate target format that matches the destination’s documented requirements.
  4. Keep the JXL source and the successfully tested derivative separately so you can re-export without starting over.

Safe conversion workflow

  1. Make a backup of the original .jxl files.
  2. Identify the destination’s required format and whether it needs transparency or animation.
  3. Install djxl for JPG or PNG conversion, or verify ImageMagick’s JXL and WebP entries for a WebP conversion.
  4. Convert one representative file first.
  5. Open the result in the destination application and check dimensions, transparency, animation frames, and visual quality.
  6. Run a batch loop only after the single-file test succeeds.
  7. Keep the original JXL files until every converted file has been accepted and backed up.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

ImageMagickJPEG XLJPGJXL conversionlibjxlLinuxmacOSPNGWebP

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.