Skip to content
smallPict
Start free

Web Performance3 min read

What Is JPEG XL, and Can Your WordPress Site Use It Safely?

JPEG XL is a newer image format from the JPEG committee. Here is what it is, why it matters, and how smallPict serves it without breaking any browser.

smallPict Team

Product

Most WordPress sites serve two kinds of images today: the JPEG and PNG files people upload, and the WebP or AVIF copies an optimizer makes from them. JPEG XL is a third modern option, and with smallPict 1.4 you can add it to your site without risking a single broken image.

What JPEG XL is

JPEG XL is an image format standardized by the JPEG committee as ISO/IEC 18181, the same group behind the original JPEG. It was designed to replace the formats the web already uses, and it does a few things in one format:

  • Lossy and lossless compression. It can shrink photos the way JPEG does, or keep every pixel the way PNG does.
  • Lossless recompression of existing JPEGs. A JPEG can be turned into a JPEG XL file without changing a pixel, and the JPEG can be rebuilt from it. We cover this in Lossless JPEG Recompression.
  • Progressive decoding. A large image can appear quickly at lower detail and sharpen as it loads.
  • Wide color and high dynamic range, for photos taken on modern phones and cameras.

Why "safely" is the real question

A new format is only useful if every visitor still sees your images. Not every browser shows JPEG XL. If a site served a .jxl file to everyone, some visitors would get a broken image.

smallPict avoids that by never serving JPEG XL alone. It uses the HTML <picture> element, which lists several versions of the same image:

HTML
<picture>  <source type="image/jxl" srcset="photo.jxl">  <img src="photo.webp" alt="..."></picture>

Each browser takes the first format it understands. A browser that supports JPEG XL loads photo.jxl. Every other browser skips that line and loads the WebP. Nothing depends on detecting the browser, so caching plugins and CDNs keep working as before.

What the smallPict beta does

JPEG XL is a beta in plugin 1.4, on every plan, including Free:

  1. Go to Settings → smallPict → Settings and turn on JPEG XL (full-size images only, beta).
  2. The output format must include WebP (WebP, or AVIF with WebP as a backup). JPEG XL is never served without WebP behind it.
  3. New uploads, and images you run through Bulk Optimize, get a JPEG XL copy of the full-size image next to the WebP.

The beta has clear limits, so nothing surprises you:

  • Full-size images only. Thumbnails and responsive image sizes keep WebP.
  • Not for images in cloud storage. Images moved with Cloud Offload keep WebP for now.
  • Same quota. An image counts once against your monthly quota, whatever formats it gets.

If the encoder cannot make a JPEG XL file for an image, for example a very large one, that image simply keeps its WebP. Your upload is never held up.

Try it before you turn it on

You can see JPEG XL for yourself without installing anything. Our free JPG to JXL converter runs in your browser, and nothing is uploaded. There is also PNG to JXL, and JXL to JPG and JXL to PNG for files you receive in JPEG XL.

When you are ready, update the smallPict plugin to 1.4 and turn the setting on.

Written by smallPict Team

Product

We build image conversion and CDN delivery for websites and apps.

Try it on your own images.

100 MB a month free. About two minutes to set up on WordPress.

More on image performance, Core Web Vitals and cloud storage.

All articles