mirror of
https://github.com/photoprism/photoprism.git
synced 2026-03-02 22:57:18 -05:00
Config: Add option to generate AVIF and/or JPEG XL thumbnails instead of (only) JPEG #552
Labels
No labels
ai
android
api
auth
awesome
bug
bug
ci
cli
config
database
declined
deprecated
docker
docs 📚
documents
duplicate
easy
enhancement
enhancement
enhancement
epic
faces
feedback wanted
frontend
hacktoberfest
help wanted
idea
in-progress
incomplete
index
invalid
ios
labels
live
live
low-priority
macos
member-feature
metadata
mobile
nas
needs-analysis
no-coding-required
no-coding-required
observability
performance
places
please-test
plus-feature
priority
pro-feature
question
raspberry-pi
raw
released
released
released
research
resolved
security
sharing
tested
tests
third-party-issue
thumbnails
upgrade
upstream-issue
ux
vector
video
waiting
won't fix
won't fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/photoprism#552
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ivangjxyz on GitHub (Nov 30, 2020).
I see that the web views of the files are transformed to .JPG, but I'd find it even cooler if .WEBP was used, or at least to have an option.
Many big websites like IKEA are using .WEBP images already, so I don't see that compatibilities are any issue any more... and the thing is that... It's better at compressing images, size-wise AND quality-wise.
https://developers.google.com/speed/webp
@prog32 commented on GitHub (Dec 7, 2020):
Just note
WebP has global coverage ~90%, reduces JPEG size by ~30%.
https://caniuse.com/?search=webp
Even more modern format AVIF (keyframe from AV1), has global coverage ~25%, reduces JPEG size by ~50% (dose not support progressive mode - image as JPEG/WebP)
https://caniuse.com/avif
@lastzero commented on GitHub (Dec 8, 2020):
Maybe later, won't do such a change shortly before a release. Keep in mind that as long as not ALL devices support WebP, you need both in practice. So you save nothing and actually need more. Storage is cheap anyway, especially in comparison to the time & money it costs us to implement WebP in addition to JPEG and make everything work under all conditions.
@tbrtje commented on GitHub (Jan 2, 2021):
All desktop and most android browsers already support WebP and Safari gained WebP-support in Version 14 on Desktop and iOS 14 on mobile, so there are no compatibility issues. You dont need JPEG anymore.
Storage isnt an issue, youre right, but bandwith often is.
@lastzero commented on GitHub (Jan 2, 2021):
Guess "most" is the keyword here... we'll have an eye on this. After 3 years of hard, unpaid work, we're happy PhotoPrism is finally stable. Give us a break 👍
@benmccann commented on GitHub (Jan 6, 2021):
This could probably be an option. It's really only IE11 and MacOS 10 and older that don't support webp. If I'm running a personal PhotoPrism instance then I know I'm not accessing it in that manner and am only using devices that support webp and so I'd rather disable jpeg to improve indexing speed and save disk space.
@lastzero commented on GitHub (Jan 7, 2021):
What about Photoshop? At best, there seem to be external plugins for WebP support. Haven't seen it in the standard format dropdown in 2021. That's a no go for me. Besides, my mother might also struggle to open a webp file when I send it to her via email.
@ivangjxyz commented on GitHub (Jan 7, 2021):
But I think the idea here is for the web interface to be faster and lighter. Obviously, using JPG for the "download" button still obviously makes the most sense.
I think it is best to load 50 lighter thumbnails and be able to download "that one picture" in JPG.
At the same time, please, do not feel like we are begging for this. I think we can all live with JPG thumbnails. It's just a nice little touch for a bit snappier experience.
@lastzero commented on GitHub (Jan 7, 2021):
Just trying to make sure everyone understands the full impact. It's also good to know that we need to be able to load images into TensorFlow and potentially other software and libraries. Each of those needs to support webp or we end up maintaining two sets of thumbnails, thus with slower indexing and higher storage requirements. Just checking browser support is not enough.
@benmccann commented on GitHub (Jan 7, 2021):
I agree with @ivangjxyz that you'd download the full image for Photoshop instead of the thumbnail
The TensorFlow callout is a really good one. It looks like TensorFlow does support webp. But we would need to make sure that our usage of TensorFlow supports webp if we wanted an option to generate only webp instead of webp+jpg.
I'm not sure if there's anything besides the browser and TensorFlow that would utilize the thumbnail?
@alexislefebvre commented on GitHub (Jan 8, 2021):
The documentation mentions HEIF for thumbnails: https://docs.photoprism.org/developer-guide/library/heif/ But no browser support it: https://caniuse.com/?search=heif
@lastzero commented on GitHub (Jan 8, 2021):
Misunderstanding: We need to convert HEIF to other formats (JPEG or WEBP doesn't matter) because there is no browser support 😉
@fallingcats commented on GitHub (Jan 8, 2021):
I just want to mention that firefox has enabled AVIF in nightly which means it will most likely land in stable in march.
@benmccann commented on GitHub (Jan 8, 2021):
AVIF still wouldn't be supported in Edge, Safari, or any mobile browser though. It's worth keeping an eye on in case that changes
@lastzero commented on GitHub (Jan 12, 2021):
@benmccann After doing a bit of research, it seems worth waiting for AVIF. Support is growing, see https://caniuse.com/avif. It offers better compression than WebP and also supports animations e.g. for video or gif previews. JPEG XL is also about to be standardized, see
Note that only JPEG & JPEG XL offer progressive decoding (although we currently don't use this feature). All other formats need to be loaded completely before an image can be displayed.
@lastzero commented on GitHub (Jan 12, 2021):
Regarding support for other image file formats in TensorFlow, see
@G2G2G2G commented on GitHub (Aug 7, 2021):
AVIF / WebP won't be added to photoshop / serif affinity etc because they're video algorithms and the companies don't seem interested in adding that at all.
JXL: Adobe, facebook (not that they matter), are already experimenting and implementing Jpeg XL, which also has turn on flags in chromium browsers and firefox. (by far the fastest adaptation of any format that has ever existed)
Half of JXL is based on FLIF which has a javascript library to decode internally in browser, JXL also has this but nobody uses it since it's getting real support. (but if you're some crazy early adopter it's doable) (actually I think the WASM jxl decoding library might only work in v8 engines (chromium / nodejs) so might not work on firefox / other browsers at all)
AVIF is superior for very low quality images, so thumbnails could be ideal with it. No video codecs have progressive decoding (which shouldn't matter if your image is like 10kb)
Technically PNG has "progressive decode" via adam7 interlacing, though it sucks compared to flif, jxl and jpeg offerings.
https://caniuse.com/avif
https://caniuse.com/jpegxl <--- edge has a flag for it because chromium supports it, however they don't for avif / don't have it enabled.. there's no mention anywhere as to why
AVIF does work in edge but you strangely need
https://www.microsoft.com/en-us/p/av1-video-extension/9mvzqvxjbq9v?activetab=pivot:overviewtab
which also enables thumbnails of AVIF and av1 codec videos (in mkv container most likely) in the file explorer and ALL PROGRAMS on that computer (including edge)
I assume windows 11 will have that on it by default in the non N versions and possibly the N versions since it's royalty free? not 100% on that but potentially all of europe won't display it by default.. (N in europe has no codecs for legality reasons)
@MaxLtv commented on GitHub (Sep 24, 2021):
Another good reason to use AVIF would be the support for higher than 8-bit colour depth. It's pretty ridiculous to still have to use 8-bit images and deal with banding or dithering while video has moved on to higher bit depths a long time ago, and even basic consumer tech is 10 or 12 bit-capable. A good enough (barely) standard is truly the enemy of progress. I wish we could finally bury it (together with sRGB, which still rears its ugly head sometimes).
@lastzero commented on GitHub (Sep 25, 2021):
We'll probably move to JPEGXL once it's generally supported. It features progressive decoding, and a max color depth of 24 bit compared to 12 bit for AVIF.
https://cloudinary.com/blog/how_jpeg_xl_compares_to_other_image_codecs
@G2G2G2G commented on GitHub (Sep 25, 2021):
Jon (the cloudinary guy) has many youtube videos demonstrating stuff as well, since flif days several years ago
https://youtu.be/UphN1_7nP8U Progressive decoding: JPEG vs JPEG XL vs AVIF
https://youtu.be/gKQXN7cPmuk JPEG XL: VarDCT block size selection (3)
@lastzero commented on GitHub (Sep 14, 2022):
PhotoPrism now offers read-only support for AVIF images. Until we have native support, they will be converted via Darktable, so colors and brightness may not be ideal:
@G2G2G2G commented on GitHub (Sep 15, 2022):
In case a "libjxl" / cjxl type library never comes to Go when/after all browsers natively support jxl I'll add this:
https://dev.to/kristoff/zig-makes-go-cross-compilation-just-work-29ho
as possible idea of slapping zig with cjxl to compile it into the Go executable.
@srett commented on GitHub (Oct 31, 2022):
Welp, looks like Google decided to make JPEG-XL the wrong horse to bet on: https://bugs.chromium.org/p/chromium/issues/detail?id=1178058#c84
We'll still be stuck with JPEG a decade from now as the only format supported everywhere I guess.
@lastzero commented on GitHub (Oct 31, 2022):
Yep, see the (duplicate) issue for details on the JPEG XL support:
@cartman29 commented on GitHub (Nov 13, 2022):
serif affinity 2 add JPEG XL Import/Export
@RafaelSchridi commented on GitHub (Feb 3, 2023):
Mozilla is Neutral on JXL
https://github.com/mozilla/standards-positions/issues/522#issuecomment-1409539985
Don't see much hope for JXL going forward, while AVIF is nearing 80% global coverage: https://caniuse.com/avif
@lastzero commented on GitHub (Jun 8, 2023):
Safari 17 added support for JPEG XL ❤️
@lbm-services commented on GitHub (Feb 26, 2024):
Nothing happend since June 2023? More arguments for avif see here:
https://aomedia.org/blog%20posts/avif-meet-the-next-level-image-file-format
Btw: why not let the user decide? (Create a switch in settings)
@lastzero commented on GitHub (Feb 26, 2024):
@lbm-services Well, I think you could say that about any of the 400 open issues we have... that doesn't mean nothing is happening, we've just identified other - higher priority - issues that we're working on first.
@lbm-services commented on GitHub (Feb 26, 2024):
Actually I tried to implement it myself, I thought it was easy at first. But since I am new to golang, I got stuck with the unmaintained(?) imaging library you use: https://github.com/disintegration/imaging
Basicalliy its just implementing a go-avif library/wrapper (like https://github.com/klippa-app/go-libheif/tree/main) to the imaging/io , I guess? If you point me at the right direction I 'd give it a try.
@benmccann commented on GitHub (Feb 26, 2024):
I switched to Immich and a main reason they haven't adopted avif yet is that the mobile app doesn't support it out-of-the-box, so I thought I'd mention mobile support as something to keep in mind here
@lbm-services commented on GitHub (Mar 3, 2024):
which mobile app. all mobile browsers support avif now.
@benmccann commented on GitHub (Mar 3, 2024):
I don't mean mobile browsers, but the mobile app. However, it looks like photoprism's mobile app was archived and is no longer being worked on, so maybe not a concern?
@lastzero commented on GitHub (Mar 3, 2024):
@benmccann @lbm-services There is one deprecated mobile app for iOS that was archived because the developers didn't have enough time to maintain it (and we couldn't add the API endpoints they requested, as these would have essentially removed all security checks).
If you take a look at our website, you'll find that there are a number of actively maintained native apps that use our API (and thumbnail images), as well as many others that aren't officially listed but still shouldn't break:
@m00nwtchr commented on GitHub (Nov 11, 2024):
Just adding that I'd like to be able to use AVIF both for thumbnails and HEVC (full size/quality) compatibility. Mobile apps shouldn't have any issues with implementing AVIF support.
@KucharczykL commented on GitHub (Mar 8, 2025):
Niche browsers like Waterfox or Zen Browser support JPEG-XL so this could be a use case for people like me who do not care about general support but I absolutely understand it not being a priority.
@Jack-Chronicle commented on GitHub (Mar 15, 2025):
Would be a good idea to have an option that lets the user select which format they want to store them in, so it could be selected based on their use cases
@lastzero commented on GitHub (Mar 15, 2025):
It seems that AVIF would be the most suitable alternative to JPEG at the moment, as it is supported by almost all modern browsers, has a generally high compression, and good image quality with a maximum resolution of 65536 x 65536 pixels:
This is how caniuse.com describes it:
Based on its feature set, I personally would (still) prefer to use JPEG XL as the successor to JPEG, but if it's not supported for political or other reasons beyond my current understanding, then so be it...