Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JPEG XL support #162

Open
veikk0 opened this issue May 8, 2022 · 16 comments
Open

JPEG XL support #162

veikk0 opened this issue May 8, 2022 · 16 comments
Assignees

Comments

@veikk0
Copy link

veikk0 commented May 8, 2022

Based on JPEG XL's compression efficiency, encoding and decoding performance, and backwards compatibility features (like lossless JPEG transcoding), it seems we're finally going to have a universal image format. The file format was standardised in October 2021, and further ISO standarisation effort is ongoing; see https://en.wikipedia.org/wiki/JPEG_XL#Standardization_status.

JPEG XL support would be a great addition to xviewer. I'm looking to use JPEG XL, but even viewer support is currently rare. The only easy-to-install viewer I was able to find for Linux Mint was the gThumb Flatpak, but it's slow to start and doesn't support animated JXLs.

The reference implementation of JPEG XL is libjxl: https://github.com/libjxl/libjxl

@darkshram
Copy link

Borrowing my own comment from several issues in pix... Just install jxl-pixbuf-loader and you will get jxl support in pix and xviewer. Packages are available in Debian, Ubuntu, Linux Mint, Fedora, etc.

Same goes for webp, heif and avif formats. Just install webp-pixbuf-loader, heif-pixbuf-loader and avif-pixbuf-loader packages from your distribution software repositories.

@mars4science
Copy link

@darkshram , hi!
I"m on Linux Mint 20.2. apt-get update; apt-get install jxl-pixbuf-loader says "E: Unable to locate package jxl-pixbuf-loader". How to install them? TIA

@darkshram
Copy link

https://github.com/libjxl/libjxl/releases

There you will find packages for Debian/Ubuntu. Mint is based on Ubuntu, so you may prefer the Ubuntu ones.

You may also try to build and install libxjl from source.

@mars4science
Copy link

@darkshram , thanks. I still wonder why they are not available in the repos. Can users realistically facilitate the process of inclusion? Maybe even included in LM distro ISO from the start? TIA

@darkshram
Copy link

A few days ago I opened an issue at the pix repository asking to add the pixbuf-loaders as soft or hard dependencies for pix. This means installing pix would require to install or at least recommend to install the pixbuf-loaders required to view webp, jpeg200, jxl, raw, heif, etc.

linuxmint/pix#152

@puroh
Copy link

puroh commented Nov 5, 2022

hi, i find this repository, in my case work in linux mint 20.3

sudo add-apt-repository ppa:krifa75/eog-ordissimo

Then, update your system's package list using APT.

sudo apt update

Next, install the library by running:

sudo apt install webp-pixbuf-loader

@clefebvre
Copy link
Member

Alright. This might happen in Mint 21.2.. the latest libjxl was just out yesterday, Ubuntu lunar is at 0.7 right now, though I don't yet see a gdkpixbuf loader in their library.

On our side we're going to wait a little bit until the dust settles and Ubuntu/Debian get a chance to package this the way they want. Then we'll need to do the following:

  • mint/lmde: Backport the JXL lib and loader
  • mint/lmde: Backport libfile-mimeinfo-perl 0.33 (for the mimetype to be identified)
  • xviewer: Recommend the loader and handle image/jxl mimetype
  • iso selection: Add the loader

I don't want to do this right now because I can't really predict how this will be packaged in Debian/Ubuntu. I don't want to do things differently and introduce differences between the distros.

@clefebvre clefebvre self-assigned this Jan 19, 2023
@mtwebster
Copy link
Member

mtwebster commented Feb 28, 2024

Update - according to this bug report, it doesn't look like we'll get the pixbuf loader for a while yet (this is what xviewer, other programs need to load these files), unless we package it ourselves.

There's a djxl utility, part of libjxl-tools (which will be available in Mint 22), which would allow us to create a thumbnailer, but it would probably be quite slow compared to if we had the pixbuf loader - we'd have to extract an image with this tool, then resize it afterward.

edit: Pix (our photo editor) will have jxl support in the next release.

@mruncreative
Copy link

mruncreative commented Oct 7, 2024

Jxl support in Pix works very well on Mint 22 but not in Xviewer and there are no thumbnails in Nemo.

@mtwebster
Copy link
Member

Install xapp-jxl-thumbnailer for nemo thumbnails. No support available yet for Xviewer, unfortunately.

@mruncreative
Copy link

xapp-jxl-thumbnailer version 1.2.5 is already installed. Still no thumbnails.

@mruncreative
Copy link

mruncreative commented Oct 8, 2024

If I look at the folder in pix with a freshly created jxl, the thumbnail appears.
If I refresh in nemo the thumbnail appears there too.
If I then refresh again (F5), it disappears from Nemo and once I switch folders and back it disappears from Pix too and won't come back in both applications no matter what.

Actually why are they cached at all? I thought you could make thumbnails for jxl images on the fly from the first x bytes because almost all jpeg xl files are progressive.

@mtwebster
Copy link
Member

Thanks for establishing some reproducibility - I'll have a look at that.

We cache thumbnails because any image formats that aren't natively supported by nemo require running an external program to generate an image - this is a lot more work than loading a native .png every time. Besides, these external programs need to output a file anyhow for nemo to load. Why not keep it around?

@mruncreative
Copy link

mruncreative commented Oct 8, 2024

Because it's a lot of duplicate data.

require running an external program to generate an image

The decoder could be integrated.
I'm not sure to how much data you need to generate a thumbnail from a file though.

@mtwebster
Copy link
Member

The 'decoder' is the pixbuf loader that isn't available yet. This will eliminate having to use a thumbnailer script, but is still going to be slower than loading an already-generated image that's already the correct size. Which is what the cache is for.

@mruncreative
Copy link

Today I tried again and it wouldn't generate a thumbnail at first, so I closed Nemo and opened the folder in pix and saved to a new jxl file again and it would display. I think Pix generates the thumbnails correctly and Nemo fucks them up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants