AnimatedPngCreator 2.0.3

dotnet add package AnimatedPngCreator --version 2.0.3
                    
NuGet\Install-Package AnimatedPngCreator -Version 2.0.3
                    
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="AnimatedPngCreator" Version="2.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AnimatedPngCreator" Version="2.0.3" />
                    
Directory.Packages.props
<PackageReference Include="AnimatedPngCreator" />
                    
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 AnimatedPngCreator --version 2.0.3
                    
#r "nuget: AnimatedPngCreator, 2.0.3"
                    
#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 AnimatedPngCreator@2.0.3
                    
#: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=AnimatedPngCreator&version=2.0.3
                    
Install as a Cake Addin
#tool nuget:?package=AnimatedPngCreator&version=2.0.3
                    
Install as a Cake Tool

AnimatedPngCreator

Creates animated PNG out ouf a sequence of Images.

Please use the newest version on NuGet. <br> Get the package on NuGet

Dispose the creator to end the creating process. On disposing the count of images will be written to the header.

24.08.2025 v2.0.0 New project stucture: AnimatedPngCreator and AnimatedPngCreator.System.Drawing or AnimatedPngCreator.SkiaSharp is needed <br> 12.10.2018 Bug fixed, tests added, new static methods added - v1.0.3 merged to master <br> 29.8.2018 Bug fixed, test added, v1.0.2 deployed on NuGet <br> 27.8.2018 Filter added to detect unchanged pixels, console app added, v1.0.1 deployed on NuGet

V1.0.3 makes it possible to use the static Create method.

The third parameter is the time to show the frame, in milli seconds.

Breaking Changes:

v2.0.0 Use BitmapFactory.FromFile instead of Image.FromFile and install AnimatedPngCreator.System.Drawing or AnimatedPngCreator.SkiaSharp

// Example 1:
var filePaths = new List<string>
{
    "1.bmp", "2.bmp", "3.bmp"
};
CMK.AnimatedPngCreator.Create("out.png", filePaths, 1000);

// Example 2:
var images = new List<Image>
{
    BitmapFactory.FromFile("1.bmp"),
    BitmapFactory.FromFile("2.bmp"),
    BitmapFactory.FromFile("3.bmp")
};
CMK.AnimatedPngCreator.Create("out.png", images, 1000);

// Example 3:
var frames = new List<Frame>
{
    CMK.AnimatedPngCreator.Frame(BitmapFactory.FromFile("1.bmp"), 1000),
    CMK.AnimatedPngCreator.Frame(BitmapFactory.FromFile("2.bmp"), 1000),
    CMK.AnimatedPngCreator.Frame(BitmapFactory.FromFile("3.bmp"), 1000)
};
CMK.AnimatedPngCreator.Create("out.png", frames);

The filter to remove unchanged pixels is on by default. If you don't want to use the filter, you just have to pass a config to the constructor:

var config = new AnimatedPngCreator.Config
{
    FilterUnchangedPixels = false
};
using (var apngCreator = new AnimatedPngCreator(outputFile, image1.Width, image1.Height, config))

Example 1:

// Add three images to an APNG
using CMK;
using System.Drawing;
using System.IO;

namespace ApngTest
{
    class Program
    {
        static void Main(string[] args)
        {
            Image image1 = BitmapFactory.FromFile("filename1.bmp");
            Image image2 = BitmapFactory.FromFile("filename2.jpg");
            Image image3 = BitmapFactory.FromFile("filename3.png");

            short frameDelay = 1000 / 5; //5 frames per second
            using (FileStream outputFile = File.Create("animated.png"))
            {
                using (var apngCreator = new AnimatedPngCreator(outputFile, image1.Width, image1.Height))
                {
                    apngCreator.WriteFrame(image1, frameDelay);
                    apngCreator.WriteFrame(image2, frameDelay);
                    apngCreator.WriteFrame(image3, frameDelay);
                }
            }
        }
    }
}

Example 2:

using CMK;
using System.Collections.Generic;
using System.Drawing;
using System.IO;

namespace ApngTest
{
    class Program
    {
        static void Main(string[] args)
        {
            List<Image> images = new List<Image>
            {
                BitmapFactory.FromFile("filename1.bmp"),
                BitmapFactory.FromFile("filename2.jpg"),
                BitmapFactory.FromFile("filename3.png")
            };

            short frameDelay = 1000 / 5; //5 frames per second
            using (FileStream outputFile = File.Create("animated.png"))
            {
                using (var apngCreator = new AnimatedPngCreator(outputFile, images[0].Width, images[0].Height))
                {
                    foreach(var image in images)
                    {
                        apngCreator.WriteFrame(image, frameDelay);
                    }
                }
            }
        }
    }
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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 netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on AnimatedPngCreator:

Package Downloads
AnimatedPngCreator.System.Drawing

AnimatedPngCreator.System.Drawing is the module to use System.Drawing for loading and writing the images AnimatedPngCreator Create animated PNGs (APNGs) easily and efficiently in .NET projects. The package provides a modular structure that separates core functionality from platform-specific wrappers, allowing developers to choose the appropriate image backend (e.g., System.Drawing or Skia) for their environment. Key Features: Generate animated PNGs from a sequence of images Modular design with separate core and wrapper packages Choose your preferred image backend without affecting core logic Compatible with multiple .NET frameworks through multi-targeting

AnimatedPngCreator.SkiaSharp

AnimatedPngCreator.SkiaSharp is the module to use SkiaSharp for loading and writing the images AnimatedPngCreator Create animated PNGs (APNGs) easily and efficiently in .NET projects. The package provides a modular structure that separates core functionality from platform-specific wrappers, allowing developers to choose the appropriate image backend (e.g., System.Drawing or Skia) for their environment. Key Features: Generate animated PNGs from a sequence of images Modular design with separate core and wrapper packages Choose your preferred image backend without affecting core logic Compatible with multiple .NET frameworks through multi-targeting

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.3 152 8/24/2025
2.0.1 271 8/24/2025 2.0.1 is deprecated because it has critical bugs.
2.0.0 263 8/24/2025 2.0.0 is deprecated because it has critical bugs.
1.0.3 7,315 10/11/2018
1.0.2 999 8/29/2018
1.0.1 1,003 8/27/2018
1.0.0 1,004 8/23/2018

Version 2.0.3 – Release Notes

New Modular Structure

The package has been restructured into a modular format.

The core functionality is now separated from the platform-specific wrappers.

Users can choose which wrapper to include (e.g., System.Drawing or Skia) depending on their environment.

Existing projects can adopt the new structure with minimal changes.