NewBeeMedia.Encoders.Gif
1.0.1.6
dotnet add package NewBeeMedia.Encoders.Gif --version 1.0.1.6
NuGet\Install-Package NewBeeMedia.Encoders.Gif -Version 1.0.1.6
<PackageReference Include="NewBeeMedia.Encoders.Gif" Version="1.0.1.6" />
<PackageVersion Include="NewBeeMedia.Encoders.Gif" Version="1.0.1.6" />
<PackageReference Include="NewBeeMedia.Encoders.Gif" />
paket add NewBeeMedia.Encoders.Gif --version 1.0.1.6
#r "nuget: NewBeeMedia.Encoders.Gif, 1.0.1.6"
#:package NewBeeMedia.Encoders.Gif@1.0.1.6
#addin nuget:?package=NewBeeMedia.Encoders.Gif&version=1.0.1.6
#tool nuget:?package=NewBeeMedia.Encoders.Gif&version=1.0.1.6
I haven’t found a satisfying GIF encoder for dotnet yet, so I built one with AI (KIMI K3).
GIF89a animation encoder based on SkiaSharp:
- Encodes multiple equally sized SKBitmap frames sequentially into a single GIF animation
- Supports scaling compression (Scale / MaxWidth / MaxHeight) to drastically reduce file size
- Frame-difference optimization: only encodes regions changed from the previous frame; unchanged pixels are output as transparent
- Toggleable LZW compression: when disabled, raw literal bitstream is used (valid GIF, larger file size but faster encoding)
- Built-in NeuQuant neural-network palette quantization (automatically trims unused colors)
- Supports transparent pixels (alpha threshold binarization), loop count, and per-frame delay
Dependencies: NuGet package SkiaSharp (written against 2.88.x API; notes inside ScaleBitmap() explain adaptation for 3.x)
Usage Example:
int delayHundredths = (int)Math.Round(100.0 / stage.FrameRate);
using var gifEncoder = GifEncoder.Create(filePath, delayHundredths);
for (int currentFrame = 0; currentFrame < frames; currentFrame++)
{
using var bmp = ...;
if (bmp == null) break;
gifEncoder.AddFrame(bmp);
}
Scaling compression example (halve width and height; file size roughly 1/4 of original):
using var gifEncoder = GifEncoder.Create(filePath, delayHundredths,
new GifEncoderOptions { Scale = 0.5 });
Or limit the longest edge:
new GifEncoderOptions { MaxWidth = 480 }
Disable frame-difference optimization / LZW compression:
new GifEncoderOptions { EnableFrameDiff = false, EnableLzwCompression = false }
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- SkiaSharp (>= 3.119.4)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on NewBeeMedia.Encoders.Gif:
| Package | Downloads |
|---|---|
|
NewBeeVG
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.1.6 | 30 | 9/28/2026 |