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

Modern image codecs supported by WIC - JXL, HEIF, AVIF, etc #4

Closed
kiwijam opened this issue May 16, 2021 · 39 comments
Closed

Modern image codecs supported by WIC - JXL, HEIF, AVIF, etc #4

kiwijam opened this issue May 16, 2021 · 39 comments
Labels
documentation Improvements or additions to documentation format support Related to add/remove/change of a specific format support. help wanted Extra attention is needed

Comments

@kiwijam
Copy link

kiwijam commented May 16, 2021

Thank you for picking up the torch on JPEGView!

It would be nice if JPEGView supported modern image codecs. In particular AVIF.

Chrome, Firefox and Safari support AVIF. Chrome by default. Firefox behind a flag. Safari's AVIF support is limited to its GTK port for now.

JPEG XL and HEIC are also worth investigating. At some point I briefly looked at JPEGView's WIC loader for HEIC but never got it to work properly.

@sylikc
Copy link
Owner

sylikc commented May 18, 2021

HEIF/HEIC:
I think I was reading from the forum # 93 Support for HEIF image format that David Kleiner (original author) wrote that HEIF is supported in Windows 10 using WIC. Can you test out that suggestion?

AVIF I'll have to go read about... all these new image formats!

@kiwijam
Copy link
Author

kiwijam commented May 18, 2021

I extended FilesProcessedByWIC and WIC actually works! Thank you! I've tried HEIC, HEIF and AVIF and they all seem to work fine with Microsoft's WIC extensions.

@neoOpus
Copy link

neoOpus commented May 18, 2021

AVIF is going to be the Image Format! once it gets adopted by major softwares and browsers no one will look back to the previous formats.

@sylikc sylikc added the documentation Improvements or additions to documentation label May 19, 2021
@sylikc
Copy link
Owner

sylikc commented May 19, 2021

I extended FilesProcessedByWIC and WIC actually works! Thank you! I've tried HEIC, HEIF and AVIF and they all seem to work fine with Microsoft's WIC extensions.

Thanks for verifying that @kiwijam . I think this will just have to be documented, either in the Readme.html or wiki. Does anyone read the Readme.html btw? (today's the first time I even opened it lol. the program is already so intuitive!)

Or maybe GitHub Pages... though as an offline lean viewer, probably Readme.html

@sylikc sylikc changed the title Support for modern image codecs Modern image codecs supported by WIC May 19, 2021
@OCD-Man
Copy link

OCD-Man commented Aug 14, 2021

I think I was reading from the forum # 93 Support for HEIF image format that David Kleiner (original author) wrote that HEIF is supported in Windows 10 using WIC. Can you test out that suggestion?

I checked that out, but I am still on Windows 7.

However I installed Copytrans a year ago which allows opening HEIC and HEIF files in Windows 7/8/8.1 and also adds thumbnails to HEIC files! Thumbnails don't work with HEIF files, but I got it to work by changing the file extension from .heif to .heic temporarily just to see if that worked. But I don't think they officially support HEIF, which probably only works since it is basically the same format as HEIC with HEIC just being Apple's version of HEIF.
https://www.copytrans.net/copytransheic/

I decided to try adding HEIC and HEIF extensions to the FilesProcessedByWIC setting in the ini file, and it worked! I was able to view both file formats in JPEGView.

HEIC takes probably less than half a second to open in JPEGView where any other format opens instantly, and HEIF takes over 5 seconds for JPEGView and even Windows 7 photo viewer to open the image. So the slowness opening these 2 formats is a problem with the WIC codec from Copytrans and not with JPEGView. Luckily IOS devices only use HEIC. Although I wonder if Windows 10 will open HEIF images without the huge delay.

I then tried AVIF, and that didn't work with either JPEGView or Windows 7 photo viewer. So definitely AVIF is not supported by the Copytrans WIC codec. So I guess Windows 7 and 8 don't have support for any other codecs that WIC supports other than HEIC and HEIF. Although I wonder if there is another WIC codec available for Windows 7/8 that supports more file formats and maybe even loads HEIF files faster.

I then realized that in that link you gave, there is someone who already mentions that copytrans works. He also says that copytrans will work with Windows 10, but the copytrans website doesn't mention that. I wouldn't use it for Windows 10 since the Windows 10 WIC codec seems to support more and probably works better.

I also wonder if the Windows 10 WIC codec can somehow be transfered and used on Windows 7. But I will only be able to try to figure that out when I eventually get to fixing my Windows 10 computer. Maybe someone else would be willing to try and figure out if that is possible.

As for adding support for many other formats, I found it interesting that the following webpage mentions that they support many formats using the Magick.NET library. I wonder if it would make it easier for you to support more formats if you were able to incorporate Magick.net in JPEGView. However imageglass loads slowly, hopefully not because of magick.net.
https://imageglass.org/docs/supported-formats

@OCD-Man
Copy link

OCD-Man commented Aug 16, 2021

I just discovered that Transparency for HEIC is not supported in JPEGView or even in Windows 7 Photo Viewer when using the Copytrans WIC codec for HEIC. I'm pretty sure animated HEIC is also not supported.

I suspect that the Windows 10 HEIC codec also doesn't support Transparency since someone had to make a plugin for paint.net to support saving HEIC files with transparency, and when using that plugin, you have to set paint.net to disable its use of the Windows 10 WIC codec for HEIC.

It would be nice if someone could test transparent HEIC with the Windows 10 WIC Codec for HEIC, as well as animated HEIC. The zip file in the following issue I posted has an HEIC image file with transparent and transluscent parts. I don't have an animated HEIC file, so someone will have to make one with an IOS 11 or later device.
#13

If transparency is not working for HEIC in Windows 10 with both JPEGView and Windows Photo Viewer, then maybe JPEGView would need to have its own codec for HEIC/HEIF to be able to support transparency rather than just needing to program support for transparency.

Imageglass supports transparency in HEIC files, and their webpage says that they use or incorporate the Magick.NET library. So maybe there is an HEIC codec in the Magick.NET library. And if all you need to do is program another codec to be used to get transparency working, then maybe the Magick.NET library or something similar can be the solution if that makes it easier for you somehow, and may also help make adding other codecs easier.
https://imageglass.org/docs/supported-formats

@sylikc
Copy link
Owner

sylikc commented Aug 23, 2021

@OCD-Man that is some good investigation ... integrating more features for HEIC/HEIF would be interesting, but not something I have bandwidth to investigate at the moment. thanks for taking the time to comment with your detailed research.

@Pentaphon
Copy link

JPEG XL

Is the most important codec here. AVIF isn't really going anywhere while JPEG XL is actually superior.

@tumagonx
Copy link

I'm still on WinXP, none of current WIC codec works on it except the very old FastPictureViewer wic codec pack.
The more formats competing the less likely they succeed. Look at webp, it came out without worthwhile competitor despite have good windows support (wic, win32 binaries/lib) and backed by chrome's majority marketshare the best it can do is for server caching not as exchange format. Heck even industrial tiff format only added webp as one of its lossy codec few years ago.

JPEG-XL has very very demanding requirement both hardware and build toolchain (how it expect to be universal? unbelievable!)
HEIC is just Apple proprietary ploy and they will still "happy" even when none of non-iSheep adopt it.
AVIF will certainly replace webp (already seen it used for image caching) but nothing more.
no individual care about squeezing some KB for incompatibility. Image format wars is similar to archive and audio format war (we still use zip and mp3 for exchange).

just my 2c rant.

@tumagonx
Copy link

I think libheif is best minimal library that can be build with visual c++ for jpegview. You get avif and heic support.

@Pentaphon
Copy link

JPEG-XL has very very demanding requirement both hardware and build toolchain

The namesake of this project alone means it should have JPEG-XL support. When JPEG-XL becomes widely used, and JPEGView doesn't have support, people are going to ask: "what is the point of this project if it doesn't even support the latest JPEG standard?"

If anything, JPEG-XL should be the highest priority for this project because:

  1. HEIC is a closed format that people were never excited about using and this is an open source project.
  2. AVIF is inferior to JPEG-XL in every comparison and the AVIF hype is dying down due to such data.
  3. JPEG-XL is not yet widely used, giving this project plenty of time to figure out how to support it, and interest is growing.
  4. Again, it's silly to have an image viewer called JPEGView not be able to view JPEG-XL when it becomes widely used.

@neoOpus
Copy link

neoOpus commented Oct 12, 2021

https://github.com/libjxl/libjxl

@sylikc sylikc added the help wanted Extra attention is needed label Oct 12, 2021
@sylikc
Copy link
Owner

sylikc commented Oct 12, 2021

It's nice to see how many people aside from myself who use JPEGView as their primary viewer. I haven't actually analyzed the code enough to add a new codec support, but this is encouraging me to dig in. If I have time to start looking into adding a new file format support, JPEG-XL will be the first one I look at.

I had a problem with CR3 files a few weeks back that I wished JPEGView can pull the RAW previews from too. Ah, so many enhancements!

@kiawizard
Copy link

I extended FilesProcessedByWIC and WIC actually works! Thank you! I've tried HEIC, HEIF and AVIF and they all seem to work fine with Microsoft's WIC extensions.

Unfortunately, in my case it doesn't work. Windows 11 x64, JPEGView 1.0.40 with FilesProcessedByWIC=.wdp;.hdp;.jxr,.heic
, the message is "Cannot read file 20220416_134424.heic". The example photo attached
20220416_134424.zip. Windows "Photos" and "Windows Photo Viewer" open the file successfully

@kiwijam
Copy link
Author

kiwijam commented Apr 17, 2022

The photo seems to work fine for me.

Here's the line from my INI:
FilesProcessedByWIC=*.dds;*.wdp;*.hdp;*.jxr;*.avif;*.heic;*.heif;*.jxl

Here's the extensions (all by Microsoft) I installed from the Windows Store:

HEIF Image Extensions
WebP Image Extensions
Raw Image Extension
Web Media Extensions
AV1 Video Extension
VP9 Video Extensions
MPEG-2 Video Extension
HEVC Video Extensions (Device)

@kiawizard
Copy link

kiwijam, thank you, I think I missed the fact that ini is overridden with the one in user's profile. Edited it through a link in jpegview's context menu, and now it works indeed!

@kiawizard
Copy link

kiwijam, and does it work if you right-click the image, Open With, choose jpegiew? In my case it still says "Cannot read file" then, but works if I run jpegview, press Ctrl+O or use an auto-opened file dialog and select the image. Interesting that drag'n'drop of the image to jpegview's window produces the same error too

@kiwijam
Copy link
Author

kiwijam commented Apr 17, 2022

Yes, I tried DnD & Open With, both work fine with the HEIC file. No idea really :(

My registry entries look like this:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.heic]
@="heic_auto_file"
"ContentType"="image/HEIC"
"PerceivedType"="image"

[HKEY_CLASSES_ROOT\heic_auto_file\shell\open\command]
@="\"D:\\Dropbox\\bin\\JPEGView64\\JPEGView.exe\" \"%1\""

Maybe Windows settings > "Choose a default app for each type of file"?

@kiawizard
Copy link

Certainly a Windows issue: although I chose "always use this app" in OpenWith dialog, the registry key ...\shell\open\command remained leading somewhere to Windows Photo Viewer. Changed registry value to the one you provided, and now everything works like a charm, thank you!

@nod5
Copy link

nod5 commented Apr 19, 2022

@kiwijam

Here's the line from my INI: FilesProcessedByWIC=*.dds;*.wdp;*.hdp;*.jxr;*.avif;*.heic;*.heif;*.jxl
Here's the extensions (all by Microsoft) I installed from the Windows Store:

Your INI line includes JXL but none of the listed extensions seems to support it. Did you get .jxl images working in jpegview and if yes what extension or other install is it dependent on?

@kiwijam
Copy link
Author

kiwijam commented Apr 20, 2022

Yep! There's a WIC loader over here: https://github.com/saschanaz/jxl-winthumb/

jxl-winthumb
A JPEG XL (*.jxl) thumbnail handler for Windows File Explorer.

Now with WIC decoding support, which means you can use Windows Photo Viewer or any WIC-capable image viewers to view JXL files.

@sylikc
Copy link
Owner

sylikc commented Jan 7, 2023

JPEG XL support was just merged in via PR #99

@Pentaphon
Copy link

JPEG XL support was just merged in via PR #99

Awesome! Also, please don't worry about HEIC. Nobody really uses HEIC and I think the people who really love this project want support for open-source image codecs and that's it.

JPEG-XL was the first priority because it is a true successor to JPEG, the namesake of this project, and now that that is done, the only remaining open source codec to support is AVIF, but even I think that will be replaced by JPEG XL someday.

@kiawizard
Copy link

Nobody uses HEIC? It is one of two formats along with jpeg (which is too old to be used) available in cameras of modern smartphones. I use HEIC and I use jpegview to view them perfectly, even 108mp

@Pentaphon
Copy link

Nobody uses HEIC?

Not enough to make it worth the trouble. JPEG-XL will eventually replace it. I have never gotten an HEIC image from an iPhone or Galaxy user.

@kiawizard
Copy link

kiawizard commented Jan 7, 2023

Which trouble? What makes you think jpeg-xl will replace it? Haven't ever seen anything which produces jpeg-xl

@Pentaphon
Copy link

Which trouble? What makes you think jpeg-xl will replace it? Haven't ever seen anything which produces jpeg-xl

Battle-of-the-Codecs_fnl

@kiawizard
Copy link

Nice theoretical picture, and which devices support it or are going to support it? What makes you think it won't share the fate of jpeg2000, which is very very good, except not used anywhere?

@Pentaphon
Copy link

Nice theoretical picture, and which devices support it or are going to support it? What makes you think it won't share the fate of jpeg2000, which is very very good, except not used anywhere?

Find me an open source codec that outperforms JPEG-XL and I will go with that instead.

@kiawizard
Copy link

Go where? Camera makers choose formats, picture viewers have to be able to show them all. Personally I store every jpeg in Dropbox Lepton format (lossless 30% compression for jpeg), shoot in HEIC, edit in WEBP, and view all 3 in jpegview

@Pentaphon
Copy link

Personally I store every jpeg in Dropbox Lepton format (lossless 30% compression for jpeg), shoot in HEIC, edit in WEBP, and view all 3 in jpegview

And...this is why JPEG-XL was needed because omg that sounds like such a complicated mess. Everything should just be in JPEG-XL format in the future so we don't have to juggle all these dumb formats.

@kiawizard
Copy link

Once again: you are not God and you are not camera manufacturer. That's strange you plan to change the world. If some viewer doesn't support some format, users having files in this format get rid of this viewer, not convert everything to the format you like

@sylikc
Copy link
Owner

sylikc commented Jan 7, 2023

Leptop? Cool

Personally I store every jpeg in Dropbox Lepton format (lossless 30% compression for jpeg), shoot in HEIC, edit in WEBP, and view all 3 in jpegview

Lepton, interesting project, I never heard of that before. I'm learning all these new formats from the community! Just looked at their GitHub, looks like it's out of support :/ https://github.com/dropbox/lepton

JPEG XL code removed from Google Chrome

Not to add to the flaming, but TBH, I was going to reply to the request for JPEG XL issue #91 with this link Google Chrome removing JPEG XL code

Google cites some of the following reasons (which, if you search around the web, there's lots of counter arguments for too. In fact that issue tracker has a lot of counters 🤷‍♀️)

  • There is not enough interest from the entire ecosystem to continue experimenting with JPEG XL
  • The new image format does not bring sufficient incremental benefits over existing formats to warrant enabling it by default
  • By removing the flag and the code in M110, it reduces the maintenance burden and allows us to focus on improving existing formats in Chrome

Regardless, to have a major web browser drop support for JPEG XL is telling (for the current fate of adoption). I think current stats puts Google Chrome with at least 50% worldwide browser share (everyone gives different stats, but it's safe to say Chrome is the most popular browser in the world).

A few days ago, I read that same Cloudinary article trying to understand what JPEG XL was in the grand scheme of things. At the same time, I was trying to find sample images for JPEG XL (I've never had one before)... it may be technically the more advanced format and open-source to boot, but that doesn't guarantee adoption. In fact, the Cloudinary article says many advanced formats support animation (with better quality, better compression, better everything) but we're still using CompuServe's GIF format!

HEIC from smartphones

Smartphone cameras these days can shoot HEIC. (No) Thanks to Apple for pushing a format they have patents on, but in iOS 11 (2017), they forced the whole ecosystem that direction. They set the default camera output to HEIC. HEIC is supported on the newer Android devices HEIC is Coming for Androids, but it's not set to default.

For now, while JPEG XL is 'technically' the most advanced format for still images, there's little adoption. When smartphone cameras start shooting it, and major browsers support it, that's a mark of success of a format (even one that's encumbered by patents)

My vision for JPEGView

IMHO, an image viewer supporting every format under the sun is a great thing. Regardless of the politics of adoption rates, what companies are pushing it, the best image viewers support everything I will ever come across. With WIC, JPEGView almost does, with some speed hits and user configuration required.

The only fear I have is that adding formats bloats the code. Currently, JPEGView x64 v1.1.41 comes in ~1.9 MB. The initial release when I adopted it JPEGView x64 1.0.37 comes in at ~1.3 MB.

This is all still very manageable, and in 2023, JPEGView is still considered very lightweight.

@Pentaphon
Copy link

Not to add to the flaming, but TBH, I was going to reply to the request for JPEG XL issue #91 with this link Google Chrome removing JPEG XL code

That's just Google trying to push their WebP and upcoming WebP2 format in the future by getting rid of support for an open standard that isn't made by Google.

This isn't WebPView. It's JPEGView, so it makes sense to go with open source formats like JPEG-XL first rather than HEIC. We already have WebP and will probably get WebP2 support as well.

@tumagonx
Copy link

tumagonx commented Jan 8, 2023

I still think none of these future format wannabes will replace jpeg simply because there are too many of them, between speed of decode/encode vs efficiency vs storage price vs compatibility, new formats dont give much incentive.

BTW @sylikc you need change jpegview requirement, cause your builds dont run on Windows XP.

@sylikc
Copy link
Owner

sylikc commented Jan 8, 2023

@tumagonx yeah, there's an issue open for that #51 which I haven't had a chance to look at yet...

@qbnu
Copy link
Contributor

qbnu commented Jan 8, 2023

Regarding Lepton, there's an alternative which does pretty much the same thing.
https://github.com/google/brunsli
https://brunsli.dev/

@sylikc sylikc added the format support Related to add/remove/change of a specific format support. label Jan 16, 2023
@sylikc sylikc changed the title Modern image codecs supported by WIC Modern image codecs supported by WIC - JXL, HEIF, AVIF, etc Feb 10, 2023
@sylikc
Copy link
Owner

sylikc commented Feb 10, 2023

I'm closing this issue... I think most of the formats requested are now supported... though it's got great resources to links on WIC things

@sylikc sylikc closed this as completed Feb 10, 2023
@neoOpus
Copy link

neoOpus commented Feb 11, 2023

Sure! Thanks for your hard work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation format support Related to add/remove/change of a specific format support. help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

9 participants