PCSX2 / pcsx2

PCSX2 - The Playstation 2 Emulator
https://pcsx2.net
GNU General Public License v3.0
11.73k stars 1.62k forks source link

[Feature Request]: JPEG XL Support #10102

Closed ZippyZolton closed 1 year ago

ZippyZolton commented 1 year ago

Description

JPEG XL is a more recent image format that's been trending upward due to its lossless compression feature, allowing for high quality images to be stored at a very small file size, significantly smaller than lossless PNG.

I have been looking through the repo and it probably shouldn't be too hard to implement this, seeing as a DLL has already been made. I might even try to do it myself, but I wanted to post this just in case I lack the motivation to do so, and to signal boost the format.

Reason

I would like to see this simple addition because it would be nice to have lossless cover art and texture replacements at a smaller file size than PNG. Since I cannot afford more storage devices, I'm very conscious about file sizes, even down to more miniscule aspects such as small images. It's also just fun for me to experiment with this new format and oogle at such small numbers on crisp and clean images!

Examples

Extremely comprehensive size comparison graph with complex images: https://docs.google.com/spreadsheets/d/1ju4q1WkaXT7WoxZINmQpf4ElgMD2VMlqeDN2DuZ6yJ8/edit#gid=1919028011

Here is a DLL for Qt, this works with Nomacs, which is an image viewer: https://github.com/novomesk/qt-jpegxl-image-plugin/releases

This DLL seems to not work with PCSX2 out of the box, which is another reason why I am making this feature request.

stenzek commented 1 year ago

I'd rather not ship a third party qt plugin, plus some people use qt from their package manager, not our build (which would mean it would be incompatible). Same with the flatpak - we use their runtime.

So you need to request this from qt instead.

ZippyZolton commented 1 year ago

Thanks for the quick response, I don't have much knowledge about Qt so I wasn't aware this was all built-in stuff. I hope this is to be added over there before I know it!

stenzek commented 1 year ago

I wouldn't have high hopes there. I'm not well-versed in the image format wars, but the patent situation combined with browsers deprecating it probably isn't a good sign.

ZippyZolton commented 1 year ago

I'm not sure what you mean by patents, but as far as deprecation it was only the official Chromium branch that explicitly stopped supporting it, because of Google's petty squabble wanting their own similar image format to take off, Safari supports the format and Firefox has it in Nightly (it's planned to come to stable without any toggle needed iirc)

stenzek commented 1 year ago

Again, not my area of interest/expertise, just remember reading something about MS owning patents which may affect JPEG-XL, and that creates some risk for software/libraries who ship it.

(the obvious workaround to that is to defer the decoding to the system, instead of your own implementation, but then we end up with the cross-platform discrepancy which I mentioned earlier)

ZippyZolton commented 1 year ago

That's weird, there's already open source JXL stuff out there, and Microsoft hasn't even started to implement JXL into Windows or Xbox