Krita 5.2 JPEG XL Export Tips
Intro
With the release of version 5.2, Krita brings a lot of JPEG XL improvement! However with added knobs and switches here and there, it can be pretty confusing for a standard user... x3
Here I'll try to give some tips to use it efficiently!
JPEG XL?
JPEG XL (or JXL for short) is a relatively new image standard by the JPEG committee (yes, the old JPEG that we all familiar with!). It's aimed to be a long-term replacement for web image delivery formats like the old JPEG and PNG. It also have basic animation function like GIF and APNG, and can have a basic layering function as well! Better compression ratio, HDR support, animation support, and up to 32-bit depth support is just a few of their enticing features for me! I myself beginning to phase out PNG for my workflow in digital painting in favor of JXL, especially for lossless storage.. Moreover on HDR pics, no more TIFF for storing simple images!
Some of the images in this post are served only in JPEG XL format, as per iOS/iPadOS 17 or MacOS 14 (Sonoma) Safari already have a native support for viewing JPEG XL images. And for other OSes, I recommend using JPEG XL enabled browsers like Waterfox.
General export options on Krita
Here's the Krita's export dialog when selecting JPEG XL format:

I'll try to break it down shortly while copying some of the descriptions from official docs.
1. Save as animated JPEG XL
JPEG XL has the ability to store small animations like GIF or APNG. This option will save as animated JPEG XL if your canvas has an animation. It is generally safe to left this option enabled even if your canvas is not animated.
2. Flatten the image
If disabled, JPEG XL has the ability to store frames as layers if it's not being used as animation, this can be useful to store multi-page images like TIFF. Its layered capabilities are very basic, and not designed to store complex layer stacks like PSD and KRA(native krita file) does. However, this option is mutually exclusive with Save as animated JPEG XL, as animated JPEG XL will have the layers flattened. Please refer to the official docs above for detailed limitations!
I don't know what the future will tell, but I recommend to leave this option enabled for web delivery / uploads. ^^
This example image is on JPEG XL only and will not visible on browsers without JPEG XL support
Example of multi-layer JPEG XL image, this one contains 6 layers. Try to open it in Krita 5.2 !
3. Encoding options
Lossy encoding
JPEG XL can use either lossy compression like the old JPEG (but much more improved!), or lossless compression like PNG. If you enable this option, it will save as lossy compression and enables some options below.
Quality
This option sets the desired quality for lossy compression. Higher values look better, but lower values have a lower file size. It defaults to 90. Please note that quality 100 in here doesn't correspond to a lossless like other apps (in more technical term, it only equals to libjxl distance 0.1). For a true lossless, you have to disable the Lossy encoding option above!
Use modular mode
Use the alternative Modular mode for lossy compression. By default, JPEG XL encodes lossy image with VarDCT mode. Sounds pretty technical to you? In short, VarDCT will look like traditional JPEG compression. You can compare the differences when exporting with low quality values!
4. Tradeoff
Or as known as Effort in another apps. The bigger the effort, the better the compression ratio will be but the encoding time will be longer!
5. Decoding speed
Only useful for web delivery optimization to give a faster decoding speed, but generally you should left this option to 0 and barely touch it.
Tips and Tricks
Originally, it should be a hands-off experience when using Krita's JPEG XL export, meaning you shouldn't fiddle much with the options! But on some use cases, it can be beneficial to tweak those options for a better compression or faster encoding time! Let's see some use cases:
-
Lossy web delivery / uploads: Check
Lossy encoding
and setTradeoff
to 7, you can experiment withUse modular mode
as well to suit your needs. For theQuality
the default 90 is usually good enough for web viewing, unless you need a specific fidelity / filesize target. -
Pixel Art / small lossless image: Uncheck
Lossy encoding
and setTradeoff
to 7. For tiny pixel art images (512px or under), you can go withTradeoff
9 as well to have a better compression. -
Medium to large lossless image: (approx 2k x 2k and up) Uncheck
Lossy encoding
and setTradeoff
to 1. Indeed this won't be as good as tradeoff 7 for the filesize, but saving time will be much faster.
I need to mention about the trick I often use to reduce color banding, but take note this only works on 16 bpc canvas or more!

Add photon noise! I usually set it around 100-1600 depends on how grainy I'd like it to be and how bad the banding is.
Take a look at some examples of photon noise on very heavy color banding!
All images below are on JPEG XL only and will not visible on browsers without JPEG XL support
this is a very bad case of color banding, that's why I need to bump the noise way higher than my usual setting.
How about the image viewers?
You can check a list of the supported softwares. I personally use ImageGlass on windows. If you don't want to install other image viewers and okay to do a little registry edit, jxl-winthumb is also a good alternative for seamless support in windows.
Closing thoughts
I can say that the export UI is not really polished yet (even as a contributor myself!). But I found out that the library that we use in Krita (libjxl) have quite a lot of options that can be fine tuned, and yet I haven't found out the better way to polish it. For example, I'd like to have the photon noise option to be easily accessible and not hidden in the advanced tab... however, I need more objective opinion to improve it even more! Your testing is very appreciated!