Jump to content

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


midora
 Share

Recommended Posts

'GIF Animations and Images' FileType Plugin (.GIF, .AGIF)


Download

Find the latest version of the plugin here: ImAGIF.FileType v1.5.zip [2021-11-16]

Thumbnail support for .agif file type: ImAGIF.Thumbnail v1.0.zip [2021-11-18]

Installer for ImAGIF.Thumbnail: ImXYZ.Thumbnail.dll Installer v1.0.zip [2021-11-18]

Some example .pdn files used to create simple animated gifs: ImAGIF.Examples v1.0.zip

 

Summary

Loads and saves GIF animation files. Animated images contain a sequence of images called frames which a viewer application can show as an animation.

 

On load the plugin loads all frames from the file and adds them as layers to a new Paint.NET document. Frame 1 will become the bottom layer and so on. Some information from the file (like frame duration or comments) will be stored in the layer names after the marker '//'.

 

On save the plugin will convert all layers to frames respecting the information found after the marker '//' in the layer names. The plugin does its best to reduce the size of the final file. The size depends on various settings.

 

Animated GIF file format restrictions

  • Maximum number of colors is 256 (transparency count as one color)
  • No alpha transparency. Only opaque and fully transparent colors are possible

 

See also

'WEBP Animations and Images' FileType Plugin

'PNG Animations and Images' FileType Plugin

 

Keywords

FileType, GIF, AGIF, Animated GIF, Animation

 

Author / Copyright

Martin Osieka

2014-2021, Martin Osieka, Switzerland
You may use this plugin together with Paint.NET w/o any restriction.

 

Installation

Follow the instructions carefully

  • Unzip the archive
  • Copy the folder ImAGIF.FileType together with its content (ImAGIF.FileType.dll/.dlc/.deps.json) into the FileTypes folder of paint.net. The location of the FileTypes folder depends on the installed variant of paint.net.
  • To avoid conflicts with other filetype plugins which support the same extension you should remove or disable them (i.e. AnimGIF.dll).

To verify the installation you should restart Paint.NET and check that in the filetype popup of the open file selector dialog is an entry starting with AGIF.

 

Compatibility

Paint.NET >= 4.3.2

 

Supported languages

The language used in the plugin depends on the language setting of Paint.NET and the support of this language by the plugin. The fallback is the first supported language of the plugin. Languages are defined in the .dlc files. This plugin supports the following languages in the moment:

  • English

  • Deutsch

 

Tutorials

@Pixey Make an animated gif with Midora's Plugin

 

'Save dialog' options

 

2021-11-16-Im-AGIF-File-Type-Save-Dialog                                  

The options on the top allow you to define and test the basic type of the image:

  • File variant:
    • GIF Animation
    • GIF Image
  • Preview button:
    Only enabled if the file variant is GIF Animation. Creates a temporary file containing the animation and plays the file in a preview window. Right click the preview window to get a context menu containing several commands.
    As long as you do not close the 'Save Configuration' dialog with OK the original file is still intact.
    So this feature allows you to test your animation without saving to a file.

 

Depending on the variant you can define some initial settings in the dialog. Initial means that they will be  redefined if the related commands are used in the layer names.

  • Comment: see Comment=
  • Maximum number of colors: see MaxColors=
  • Dithering level: see DitherLevel=
  • Threshold: see Threshold=
  • Frame duration: see Duration=
  • Cycles: see Cycles=
  • Remove duplicates from frames: see NoDups=

 

 

 

 

 

 

 

'Load dialog' options

None

 

Commands defined in the layer names

See ImAGIF.FileType.ReadMe.txt

 

How to create/edit an animated GIF

See ImAGIF.FileType.ReadMe.txt

 

Credits

Rick Brewster for the Octree Quantization implementation used to reduce the amount of colors.

 

History

  • 1.5 [2021-11-16]
    - Fixed a bug regarding the offset of sub frames (introduced in 0.13.2)
    - Added simple preview
  • 1.4 (6.11.2021)
    - Created a new topic in the 'FileType Plugins' section (old topic is Animated Images)
    - Updated code to support paint.net 4.3.2 (replaced obsolete and deprecated methods)
    - Shifted the version number from 0.13 to 1.4
    - Prepared for future improvements

  • 0.13 (12.7.2019)
    - Rick Brewster
      This plugin didn't work with Paint.NET 4.2 because it used a class that's now
      flagged "internal". This has been fixed in v0.13.

  • 0.12 (17.8.2015)
    - Fix to handle GIFs containing corrupted XMP metadata

  • 0.11 (6.4.2015)
    - Added switch to create non-animated GIFs from flattened layers
    - Added support to load true color gifs (save is disabled, because most
      viewers are not able to view them correct and Animated GIFs are not able to
      support true color).
    - Added 'NoDups' command (default: true) and dialog option.

  • 0.10 (3.4.2015)
    - Added some initial options to the save dialog. These options will be
      overridden if their related commands are used in the layer titles.

  • 0.9 (2.4.2015)
    - Added "Duplicate=N,M" command, which duplicates the last N frames sequence
      M times. M is optional with a default value of 1.
    - Added optional origin coordinates to the sprite command. "sprite=NAME,X,Y"
    - Added "DitherLevel=N" 0 <= N <= 8, default is 7.
      Dithering is used in low color filetypes to avoid banding of colors.
      The advantage of dithering is a better quality of the final image.
      The disadvantage is that the file size may increase.
    - Changed the definition of background and foreground command a bit to allow
      to switch off usage of a background and foreground and not just to replace it.
    - Declared the command names background, foreground, default, skip, and sprite
      as depreciated. The new names are:
      UseAsBackground, UseAsForeground, UseAsDefault, UseAsNote, UseAsSprite
      The prefix UseAs indicates that the layer will not create a new frame.
    - N fps (frames per second) is allowed now to define the duration.

  • 0.8 (30.3.2015)
    - Removes duplicates (frames with the same content as the previous one)
      by removing the frame and incrementing the duration of the previous frame.
    - Because some image hosters deliver html code in a gif file instead of an
      image the filetype throws now a more descriptive exception on load of a GIF:
      "File contains an HTML document but not a GIF image"
    - Added two commands which allow to animate sprites on frames
      "sprite=NAME" defines the layer content as a sprite with the name NAME.
      A sprite layer can be drawn at any position in the layer stack.
      Sprite names are not case-sensitive and must be unique. Don't use
      whitespace or any delimiters in the names.
      "draw=NAME,X,Y" draws the sprite NAME to the frame generated from the current
      layer. X and Y are optional and define how much pixels the sprite should be
      moved (default: no move). Multiple 'draw' commands are allowed in a layer name.
      The sprite layer should be transparent because the content will be blended
      on top of the current frame.

  • 0.7 (26.3.2015)
    - fixes an issue on XP and some Win7 installations where cloning of the bitmaps
      provided by the layers will return the original ones. So the filetype
      may corrupt the layer content in version 0.6.
    - added optional parameter to the 'reverse' command to define the number of
      frames to reverse.
    - added transition 'Blinds=D' (D may be hor or ver)
    - '://' sequences are allowed now in comments because this sequence is needed
      for URLs (all other '//' sequences will be removed from comments because
      they are used to start a command sequence in the layer names)

  • 0.6 (21.3.2015)
    - New setting 'GIF'. Will be added to the first layer on load (just a hint for
      other tools about the source of the layers).
    - New setting 'reverse'. Adds all frames generated up to the current layer in
      reverse order to the animation (not including the first and the current frame)

  • 0.5 (17.3.2015)
    - added 'default' setting. Not used by agif, has the same effect as 'skip'
    - added transition=T,V,D comamnd to create additional frames in-between existing
      ones.

  • 0.4 (14.3.2015)
    - A basic quantization variant is working
    - maxcolors=N; may be used to reduce the colors, default is 256; minimum is 8
    - Added 'Animating in paint.net is easy.pdn' to demonstrate usage of background
      and foreground.

  • 0.3 (12.3.2015)
    - First public test release

     

 

 

Edited by midora
  • Like 2
  • Upvote 4
  • You're a Smart Cookie! 1

midoras signature.gif

Link to comment
Share on other sites

Added .agif shell extension to the first post. It provides thumbnail support for the file type .agif in Windows Explorer.

 

I'm not able to delete really old stuff, so I can not upload 'ImAPNG.FileType' and 'ImAPNG.Thumbnail' in the moment...

midoras signature.gif

Link to comment
Share on other sites

I deleted the old file, saved the edit, edited it again and the dialog told me that there are 565kb left. The upload file is just 45kb (because I splitted the upload in plugin and examples). There are days the upload or just writing topics takes several tries. It's just this forum for me. It doesn't depend on the browser (Firefox, Edge or Chrome).

midoras signature.gif

Link to comment
Share on other sites

  • midora changed the title to 'GIF Images and Animations' FileType Plugin (.GIF, .AGIF) [Latest v1.5 2021-11-16]
On 11/6/2021 at 1:50 PM, midora said:

(be warned the installation of this shell extension is not easy 😉)

 

That's very, very true 😲 I'd like some clarification please.

 

1.  Does one make a folder in this location? C:\Windows\Microsoft.NET\Framework64\v4.0.30319

                          I made a new folder in there and called it 'Thumbnail'.

 

2. I then copied the location and added it to the code you gave:  cd {Thumbnail}
{regasm folder}\RegAsm.exe /codebase abc.Thumbnail.dll

 

3. I then tried, in Admin mode/command, to do the rest, but it doesn't work :(

30b8T8B.gif

How I made Jennifer & Halle in Paint.net

My Gallery | My Deviant Art

"Rescuing one animal may not change the world, but for that animal their world is changed forever!" anon.

 
Link to comment
Share on other sites

You should place the folder somewhere in the user space, not on a removable disk and not in a system folder with admin rights.

What's the output of the regasm tool?

 

Anyway I will create a small application to install/uninstall these thumbnail files (in the moment there are already 12 on my side) in a proposed location. Shouldn't be to complex. But I like to close the implementation of the apng format first. The save part of apng is now promised for some years and still not available.

 

I would also prefer that the normal gif, png, webp thumbnails should show an indication if they are containing an animation. Id did this for bmp containing this bmrl format.

 

I will do the installer before I'm looking to improve the speed creating the frames of animations. There are some parts of the implementation where multiple tasks are possible. And the code can be used in all implementations. Trying to save your aquarium takes much too long an my pc.

 

 

midoras signature.gif

Link to comment
Share on other sites

this plugin looks great, but im having issues with it. i had a fresh install of paintnet, and keep getting this plugin error:

Spoiler

D:\Program Files\PaintNet\FileTypes\ImAGIF.FileType.dll, version 1.5.0.0

System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

 

i tried to fix the HKLM error on my own, but i hope it's unrelated because i failed haha

Link to comment
Share on other sites

Color Harmonies works for me in 4.3.3 and 4.3.3 (if the OptionBasedLibrary files are in the Effects folder).

The development of OptionBasedLibrary is halted in the moment until I get a better idea how to fulfill the new rules in an optimized way.

So I'm updating PropertyBased file types in my spare time.

midoras signature.gif

Link to comment
Share on other sites

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.

 

midoras signature.gif

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]

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