Universal.Common.Formats.Gif 2.1.0

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

Universal.Common.Formats.Gif

Library for reading and decoding GIF files - cross-platform, dependency-free.

Quickstart

Gif.Header header = Gif.ReadHeader(stream);
Gif.LogicalScreenDescriptor descriptor = Gif.ReadLogicalScreenDescriptor(stream);

Console.WriteLine($"{header.Version}: {descriptor.Width}x{descriptor.Height}");

Or, for just the pixel dimensions via the shared Universal.Common.Image abstraction:

Dimensions dimensions = new GifDimensionsReader().Read(stream);

And to decode the image data itself to RGBA8 pixels:

DecodedGif decoded = GifDecoder.Decode(File.ReadAllBytes("picture.gif"));

// decoded.Rgba is decoded.Width * decoded.Height * 4 bytes, row-major, R-G-B-A.
Console.WriteLine($"{decoded.Width}x{decoded.Height}");

GifDecoder handles GIF87a and GIF89a, LZW decompression, global and local color tables, and both interlaced and non-interlaced data. Two deliberate limits, both chosen to match PowerPoint's own still-export rendering of an inserted GIF:

  • Only the first image frame is decoded - no animation, no interframe disposal.
  • The Graphic Control Extension's transparent-color-index flag is parsed but not honored - every decoded pixel is fully opaque, and a transparent-flagged index decodes to its literal color table entry rather than to transparency.
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 is compatible. 
.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.

NuGet packages (9)

Showing the top 5 NuGet packages that depend on Universal.Common.Formats.Gif:

Package Downloads
Universal.Common.Formats.Pptx.Rendering

Lays out and renders PPTX slides.

Universal.Operative.Sdk.Discrete.Anthropic

Anthropic Messages API adapter for Universal.Operative.Sdk.Discrete.

Universal.Operative.Sdk.Discrete.Anthropic.ClaudeAgentSdk

Claude Agent SDK model adapter for Universal.Operative.Sdk.Discrete.

Universal.Operative.Sdk.Discrete.LMStudio

LM Studio native and compatibility API adapters for Universal.Operative.Sdk.

Universal.Common.Formats.Docx.Rendering

Lays out and renders DOCX documents.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.0 2,453 8/19/2026
2.0.0 180 8/5/2026
1.0.0 116 8/5/2026

Added GifDecoder, decoding GIF87a/GIF89a image data to RGBA8 pixels: LZW
decompression, global and local color tables, and interlaced or non-interlaced data. Two deliberate
limits, both matching PowerPoint's own still-export rendering: only the first image frame is decoded
(no animation or interframe disposal), and the Graphic Control Extension's transparent-color-index
flag is parsed but not honored - every decoded pixel is fully opaque, with a transparent-flagged
index rendered as its literal color table entry.