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
<PackageReference Include="Universal.Common.Formats.Gif" Version="2.1.0" />
<PackageVersion Include="Universal.Common.Formats.Gif" Version="2.1.0" />
<PackageReference Include="Universal.Common.Formats.Gif" />
paket add Universal.Common.Formats.Gif --version 2.1.0
#r "nuget: Universal.Common.Formats.Gif, 2.1.0"
#:package Universal.Common.Formats.Gif@2.1.0
#addin nuget:?package=Universal.Common.Formats.Gif&version=2.1.0
#tool nuget:?package=Universal.Common.Formats.Gif&version=2.1.0
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 | Versions 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. |
-
.NETStandard 2.0
- System.Memory (>= 4.6.3)
- Universal.Common (>= 8.4.1)
- Universal.Common.Image (>= 2.0.0)
-
.NETStandard 2.1
- Universal.Common (>= 8.4.1)
- Universal.Common.Image (>= 2.0.0)
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.
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.