AnimatedImage 2.1.0

dotnet add package AnimatedImage --version 2.1.0
                    
NuGet\Install-Package AnimatedImage -Version 2.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AnimatedImage" Version="2.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AnimatedImage" Version="2.1.0" />
                    
Directory.Packages.props
<PackageReference Include="AnimatedImage" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AnimatedImage --version 2.1.0
                    
#r "nuget: AnimatedImage, 2.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AnimatedImage@2.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AnimatedImage&version=2.1.0
                    
Install as a Cake Addin
#tool nuget:?package=AnimatedImage&version=2.1.0
                    
Install as a Cake Tool

A library to read animated GIF images , animated PNG images and animated WEBP images, usable in code.

When displaying in the UI, consider using AnimatedImage.Avalonia or AnimatedImage.Wpf instead of this library.

How to use

This library abstracts pixel read/write operations, requiring you to implement them yourself. For implementations using SkiaSharp, please refer to BitmapFaceFactory and BitmapFace.

The following code opens a GIF image and renders its frames.

// Read image file
using var imageStream = File.Open("/path/to/image.gif", FileMode.Open);
FrameRenderer.TryCreate(imageStream, new BitmapFaceFactory(), out var renderer);

// If you want to draw an image by frame index.
renderer.ProcessFrame(9);

// If you want to draw an image by time span.
renderer.ProcessFrame(TimeSpan.FromSeconds(34));

// Get the rendererd image.
var bitmapface = (BitmapFace)renderer.Current;
SKBitmap image = bitmapface.Bitmap;

WebP supporting

To use WebP, AnimatedImage.Native library is required.

Features

  • Animates GIF images in a normal Image control; no need to use a specific control
  • Takes actual frame duration into account
  • Repeat behavior can be specified; if unspecified, the repeat count from the GIF metadata is used
  • Notification when the animation completes, in case you need to do something after the animation
  • Animation preview in design mode (must be enabled explicitly)
  • Support for controlling the animation manually (pause/resume/seek)
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
.NET Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on AnimatedImage:

Package Downloads
AnimatedImage.Avalonia

A library to display animated GIF, PNG and WebP images in AvaloniaUI

AnimatedImage.Wpf

A library to display animated GIF, PNG and WebP images in WPF

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.0 240 9/13/2025
2.0.0 183 11/30/2024