Jump to content

'GIF Animations and Images' FileType Plugin (.GIF, .AGIF) [Latest v1.5 2021-11-16]


midora
 Share

Recommended Posts

1 hour ago, midora said:

I'm looking for an ImAGIF.FileType dll version <= 0.12. You may know that I lost access to all my sources in 2015. When I became active again on this forum (beginning of 2021) there was just a modified version available which used already octree to quantize colors (my versions used the old built-in quantizer of paint.net). There are issues with all these octree versions and I would like to compare the output of v1.5 with an older version of the plugin. I.e loading Pixeys Aquarium sig (5,8 MB) and resaving creates a 19 MB file with v1.50. I already fixed some issues and could reduce the output to 10 MB and I have an idea what's going on. But it would be easier to first compare it with the old implementation.

 

So if someone has an older dll archived and could provide it to me then I could recompile it and check for differences.

 

 

If you're looking for a better octree quantizer, you can adapt the code from https://github.com/paintdotnet/PaintDotNet.Quantization

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

I've got these archived if you need any of them

 

image.png

Link to comment
Share on other sites

8 hours ago, Rick Brewster said:

 

If you're looking for a better octree quantizer, you can adapt the code from https://github.com/paintdotnet/PaintDotNet.Quantization

 

Hi Rick. I know. But I guess the main issue is that the process of quantization and dithering should result in similar frames. Octree is for sure quite good for still images but it may not work optimal for animated frames.

 

midoras signature.gif

Link to comment
Share on other sites

Thanks to all for your help.

@Red ochre yes I would take the 0.6 😉 Older ones make no sence.

A v0.9 would be greate because this one introduced dithering.

 

In the meantime I figured out what's the issue with Pixeys gif. The gif starts with a frame of 256 colors (the gif limit) but adds more and more colors so that the last frame contains more than 10000 colors. This is legal but not supported by the plugin in the moment. Looking to the first and to the next frame you wouldn't expect that these two frames are using 10000 different colors. I'm pretty sure you wouldn't see a big difference if both frames would use the same 256 colors. And the file size would shrink.

At the end you have to find a compromise between encoding speed and final file size.

midoras signature.gif

Link to comment
Share on other sites

12 hours ago, midora said:

 

Hi Rick. I know. But I guess the main issue is that the process of quantization and dithering should result in similar frames. Octree is for sure quite good for still images but it may not work optimal for animated frames.

 

 

You could generate a palette for all frames by writing an IBitmapSource implementation that contains all of the frames as one large virtualized bitmap. Either (width * N) or (height * N). Just feed them all in. Once you have the palette, use it with the QuantizedBitmapSource for each frame individually.

 

IBitmapSource does not need to be a real Bitmap under the hood, so memory use is efficient. It can -- and should -- be virtualized. e.g. if it's asked for row N, assuming you use the (height * N) approach, you provide (row N % individual frame height) from frame (N / individual frame height)

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

  • midora changed the title to 'GIF Animations and Images' FileType Plugin (.GIF, .AGIF) [Latest v1.5 2021-11-16]

Six years ago not a lot of applications or browsers accepted files with extension .agif.

This has changed in the meantime. So I would like to share a list of applications which worked without changing back the extension of files to .gif.

Together with ImAGIF.Thumbnail there may be no longer a reason to rename the file.

  • firefox
  • google chrome
  • ms edge
  • paint.net (with ImAGIF.FileType plugin)
  • gimp

Feel free to contribute to the list. I may add it to the first page.

Edited by midora
  • Like 1
  • Upvote 1

midoras signature.gif

Link to comment
Share on other sites

Tip:

After installing ImAGIF.Thumnail you could change in the registry HKEY_CLASSES_ROOT\.agif\PerceivedType from image to video.

Windows Explorer will then no longer show the image shadow instead the .agif image will be decorated with a video frame (for some reason only if width > height).

 

1699467167_CuriousCat.agifwithvideoframeinWindowsExplorer.png.55dd9b20abfd04bd49fa533fd7e38f4f.png

Maybe I will add this feature to the Thumbnail Installer.

midoras signature.gif

Link to comment
Share on other sites

7 hours ago, midora said:

Windows Explorer will then no longer show the image shadow instead the .agif image will be decorated with a video frame (for some reason only if width > height).

 

The proper way to disable the image shadow is to set the Treatment registry value, see https://docs.microsoft.com/en-us/windows/win32/shell/thumbnail-providers#thumbnail-adornments.

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

30 minutes ago, midora said:

My Win10 registry doesn't contain any 'Treatment' keys and 'PerceivedType' works fine.

 

My guess is that all of the file extension handlers you have installed use the OS default adornments for their PerceivedType, the Treatment key would only be created if a thumbnail handler needed to override the OS default thumbnail adornments.

 

You could change your installer to create a REG_DWORD key at HKEY_CLASSES_ROOT\.agif\Treatment and set the value to 0, this would tell the OS to not use a drop shadow for that image format.

If you want to force the image to use a video frame, set the Treatment value to 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

The ImAGIF installer sets the PerceivedType to 'image' in the moment as defined in https://docs.microsoft.com/en-us/windows/win32/shell/app-registration?redirectedfrom=MSDN (that's why the thumbnails are getting the drop shadow).

 

But if I'm changing the installer in the future to allow the user to select the kind of thumbnail decoration I will also check out if Treatment works as described.

 

Maybe Treatment sets the default and PerceivedType overrides it.

midoras signature.gif

Link to comment
Share on other sites

1 hour ago, midora said:

Maybe Treatment sets the default and PerceivedType overrides it.

 

I think it is the other way around.

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

I guess the main issue setting Treatment in the Installer is that it requires a ProgId.

HKEY_CLASSES_ROOT
   .{ProgId}
      Treatment

This would mean applications like paint.net could override the default decoration of the thumbnails.

midoras signature.gif

Link to comment
Share on other sites

Dear @midora,

 

I'm having an issue when I save an animated gif, the size of the image changes from the original file.

I need to save the animated gif exactly as 112x112.

Any idea why this is happening? Any workaround?

 

For example, the original of this was 112x112 but comes out as 100x110 when saving.

 

Heart4A.gif.c4f8a000cc99df1cfab22a7658b519bb.gif

 

Thanks,

Tom.

Link to comment
Share on other sites

Hi @Tomsha the gif you added to the forum is 112x112. Also resaving it from paint.net created a 112x112 image. So please check again. What are the dimensions paint.net is showing in the status line before you are saving the file? What are the settings you are using in the save dialog?

 

Edited by midora

midoras signature.gif

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...