Let's see how to setup and run
cjxl (and its sibling
djxl) on a simple shared hosting provider so you can encode and decode JPEG-XL (aka JXL) images.
There are better ways to install libjxl and its command-line tools but they require you to have sufficient privileges on your computer or server. With inexpensive shared host such as Dreamhost (buy hosting with my affiliate link) you're limitted in what you can do. Worry not, it's still possible!
2. Download and uncompress
3. Copy the
cjxl (and optionally
djxl for decompressing jxl files) and copy (e.g. FTP) them to you home directory in a
/jxl directory maybe, like
4. ssh and change permissions so these files are executable
chmod +x cjxl chmod +x djxl
(Or don't ssh and use your FTP program to make the files executable)
To test go to any directory with an image and try for example:
$ ~/jxl/cjxl guitar-pedals.jpg guitar-pedals.jxl
Lo! Hello, 21st century!
How do you know the JXL is not corrupt in any way? Well...
Test in Firefox nightly
1. Download Firefox nightly from here
2. Go to
3. Check the box "Media: JPEG XL"
4. Load the image e.g. https://www.phpied.com/files/blogimages/guitar-pedals.jxl
- Why JXL? It's the future!
- Why now? iOS 17 is around the corner. Suddenly the browser support will be much larger, including desktop Safari and iOS Safari and non-Safari browsers on iOS.
- Why me? Chrome folks need a little nudge. They want to see adoption before they re-add support to Chrome (this is a speculation, based on their reasons to remove it in first place). So we, the Web developers, need to demonstrate interest.
- Why shared host? Shared hosting still powers large population of sites out there (another speculation, based on personal experience). It's affordable and there are no surprise bills. People use it. I use for this here site and all my sites actually.
I think I'll try my luck with a WordPress plugin that helps with the adoption. Stay tuned.