Jump to content

Heic FileType Plus (10-26-2021)


null54
 Share

Recommended Posts

This plugin allows HEIC images to be loaded and saved with transparency, and adds a few more options when saving.

It replaces Paint.NET's built-in HEIC support.

 

This plugin may produce smaller files than Microsoft's encoder for grayscale images.

For most color images Microsoft's encoder is faster and produces smaller files.

 

btn_donate_SM.gif

 

Compatibility: 4.3.2+

 

Installation:

 

1. Close Paint.NET.
2. Place HeicFileTypePlus.dll, HeicFileTypePlusIO_ARM64.dll, HeicFileTypePlusIO_x86.dll and HeicFileTypePlusIO_x64.dll in the Paint.NET FileTypes folder which is usually located in one the following locations depending on the Paint.NET version you have installed.

  Classic: C:\Program Files\Paint.NET\FileTypes    
  Microsoft Store: Documents\paint.net App Files\FileTypes

3. Open the Windows Run dialog (Start > Run or Windows Key + R)
4. Type paintdotnet:/set:FileTypes/BuiltInHEICFileTypeEnabled=false and press the Enter key
5. Restart Paint.NET.

 

Download:

HeicFileTypePlus.zip

 

Source Code:

https://github.com/0xC0000054/pdn-heicfiletype-plus

  • Like 4
  • Thanks 1
  • Upvote 3

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

Release version 1.0.1.

Changes:

  • Allow the chroma subsampling mode to be configured when saving (4:2:0, 4:2:2 or 4:4:4)
  • Add forum and GitHub links to the UI
  • Upgraded to libheif version 1.8.0
  • Upvote 1

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

  • null54 changed the title to Heic FileType Plus (09-13-2020)

Release version 1.0.2.

Changes:

  • Fixed an issue with the error handling code.
  • Fixed a typo in the assembly description

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

  • null54 changed the title to Heic FileType Plus (09-27-2020)

Release version 1.0.3.

Changes:

  • Upgraded to libheif version 1.9.1
  • Fixed an issue when saving YUV 4:2:2 and YUV 4:4:4 images

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

  • null54 changed the title to Heic FileType Plus (11-03-2020)

Release version 1.0.4.

Changes:

  • Upgraded libde265 to version 1.0.8.
  • Added support for saving lossless RGB images.

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

  • 3 months later...

This plugin solved the issue I was having where HEIC photos taken on my Samsung Galaxy S20 Ultra weren't able to be opened in Paint.NET (or the built in Windows Photos app, even after installing the HEIF extensions from Windows store)!

 

Thank you!

 

(This plugin should probably replace the default HEIC support, in my opinion.  The built in HEIC support is broken.)

Link to comment
Share on other sites

9 hours ago, skrowl said:

(This plugin should probably replace the default HEIC support, in my opinion.  The built in HEIC support is broken.)

 

Unfortunately, that will most likely never happen due to the licensing royalties that HEVC has.

 

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

  • null54 changed the title to Heic FileType Plus (10-26-2021)

Release version 1.0.5.

Changes:

  • Added support for the ARM64 builds of Paint.NET.
  • Updated libheif to version 1.12.
  • Fixed a compatibility issue with Paint.NET 4.3.
  • Like 1
  • Upvote 1

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

This plugin worked great for me, thanks!  My only remaining issue is that the command to disable the built-in HEIC codec is user specific.  Is there a way to set it for all users?  I saw that it created a registry entry in the HKCU hive, but trying to set it at the same place in HKLM didn't work.

Link to comment
Share on other sites

2 hours ago, Kelderek said:

Is there a way to set it for all users?

 

Not currently.

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

3 hours ago, Kelderek said:

This plugin worked great for me, thanks!  My only remaining issue is that the command to disable the built-in HEIC codec is user specific.  Is there a way to set it for all users?  I saw that it created a registry entry in the HKCU hive, but trying to set it at the same place in HKLM didn't work.

 

You're trying to activate this plugin for all users of the system, I take it? Can you give us some more detail on your scenario?

 

I believe I made the "scope" for this setting CurrentUser as a conservative test-the-waters kind of thing. I'm open to expanding it.

 

(The 4 scoping values are CurrentUser, SystemWide, CurrentUserWithSystemWideOverride, and SystemWideWithCurrentUserOverride)

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

4 hours ago, Rick Brewster said:

 

You're trying to activate this plugin for all users of the system, I take it? Can you give us some more detail on your scenario?

 

I believe I made the "scope" for this setting CurrentUser as a conservative test-the-waters kind of thing. I'm open to expanding it.

 

(The 4 scoping values are CurrentUser, SystemWide, CurrentUserWithSystemWideOverride, and SystemWideWithCurrentUserOverride)

I am the IT guy for a small company and Paint.NET + a plugin pack that I compiled get deployed to our systems automatically.  They get deployed as a different account from the primary computer user, so a per user scoping would mean needing an extra login script or special instructions if someone needs HEIC to use this plugin.

 

From the scopes you listed, I think SystemWideWithCurrentUserOverride would make the most sense because plugins aren't user specific.  If someone needed built-in HEIC support for some reason, they could still override the system default.

Link to comment
Share on other sites

Okay that makes sense to me, I can make the change for the upcoming 4.3.3 update (which will also remove /createMsi but add downloadable MSI packages, btw). You can, of course, do user-specific plugins by placing them into `Documents/paint.net App Files/{Effects, FileTypes, Shapes}` but that has the same complications around extra login scripts.

 

You may also be interested in the Plugins/AllowLoadingPluginsFromUserLocations setting to disallow the ability for users to install their own plugins into documents. Set it to "false" (string). I put that in a long time ago but never publicly documented it. It is scoped as CurrentUserWithSystemWideOverride.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Thanks for putting in the change!  Does that mean there will be an HKLM registry entry instead of the HKCU one?  It is easier for me to deal with registry entries than the paintdotnet:/set:FileTypes/BuiltInHEICFileTypeEnabled=false command, as a side effect of the command is that Paint.NET is left running under the deployment user's context.

 

Good to know about the user specific plugins!  I may use that when I help people on their personal computers so they aren't modifying things in Program Files.  Also the command to block it is very good to know so I can prevent them from running arbitrary plugin code on work systems.  Does that go at HKLM\Software\paint.net?

Link to comment
Share on other sites

11 minutes ago, Kelderek said:

Does that mean there will be an HKLM registry entry instead of the HKCU one?

 

The HKLM hive will be used if the value is not found in the HKCU hive.

 

11 minutes ago, Kelderek said:

Also the command to block it is very good to know so I can prevent them from running arbitrary plugin code on work systems.

Does that go at HKLM\Software\paint.net?

 

Yes.

  • Like 2

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

  • 3 weeks later...

@null54  Getting an error message after updating to beta version of PDN.

 

Version 1.0.4.0 of HeicFileTypePlusPlugin not compatible with this version of paint.net.  It says a mandatory update is available, but it's the same version of plugin. Thanks.

 

 

Link to comment
Share on other sites

1 hour ago, lynxster4 said:

It says a mandatory update is available, but it's the same version of plugin.

 

Fixed, I had accidentally bundled a plugin DLL with the wrong version number.

  • Like 1

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

On 11/2/2021 at 6:14 AM, Kelderek said:

Thanks for putting in the change!  Does that mean there will be an HKLM registry entry instead of the HKCU one?  It is easier for me to deal with registry entries than the paintdotnet:/set:FileTypes/BuiltInHEICFileTypeEnabled=false command, as a side effect of the command is that Paint.NET is left running under the deployment user's context.

 

Good to know about the user specific plugins!  I may use that when I help people on their personal computers so they aren't modifying things in Program Files.  Also the command to block it is very good to know so I can prevent them from running arbitrary plugin code on work systems.  Does that go at HKLM\Software\paint.net?

 

BTW you can try this out with the beta release of 4.3.3, 

 

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

It is fully working for me with PDN 4.3.3, the latest version of this plugin, and moving the FileTypes registry entry from HKCU to the HKLM hive.  Now every user on the computer can open HEIC files with no extra steps necessary.  Thanks, everyone!

Edited by Kelderek
  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...
4 hours ago, PFlem said:

Still getting an error trying to open a HEIC file.  Running version 4.3.4

 

Please share the error with us, otherwise we have no chance of what's going on

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Here is the beginning of the error.  It is saying that the HEIC file is invalid, but others were able to convert the file to a JPG and view it that way.

 

Exception:

System.FormatException: The HEIC file is invalid.
   at HeicFileTypePlus.HeicNative.HandleReadError(Status status)
   at HeicFileTypePlus.HeicFile.Load(Stream input)
   at PaintDotNet.FileType.Load(Stream input) in D:\src\pdn\src_4_3_x\Data\FileType.cs:line 498
   at PaintDotNet.Functional.Func.Eval[T1,TRet](Func`2 f, T1 arg1) in D:\src\pdn\src_4_3_x\Base\Functional\Func.cs:line 158

Link to comment
Share on other sites

1 hour ago, PFlem said:

It is saying that the HEIC file is invalid, but others were able to convert the file to a JPG and view it that way.

 

Please share the file so this can be investigated.

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...