Sdcb.SimdCodecs.Webp 1.2.0

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

Sdcb.SimdCodecs.Webp

Pure-managed WebP decoding for .NET 10, derived from RFC 6386 and RFC 9649. There is no encoder.

Supported input includes VP8 lossy, VP8L lossless, ALPH transparency, and animated WebP with full-canvas RGBA frames, random seeking, and frame timing. ICC, EXIF, and XMP metadata are preserved. The Sdcb.SimdCodecs facade decodes a still image or frame 0 of an animation with TryDecode, and every frame with TryOpenFrames; this package's animation API adds seeking by timestamp and the frame rectangles. Images larger than 67,108,864 pixels are rejected to bound decoder allocations.

using Sdcb.SimdCodecs.Webp;

byte[] data = File.ReadAllBytes("image.webp");
WebpImage image = WebpDecoder.Decode(data);
Console.WriteLine($"{image.Width} × {image.Height}");

Decode into your own RGBA buffer (stride 0 = tightly packed). A tightly packed destination is also the lossless decoder's working buffer, so a lossless decode needs almost no memory of its own:

WebpInfo info = WebpDecoder.ReadInfo(data);
byte[] rgba = new byte[info.Width * info.Height * 4];
WebpDecoder.DecodeTo(data, rgba);

Decoding is single-threaded by default. Opt in to decoding the transparency plane of a lossy image on a second thread, concurrently with the colour image:

WebpDecoder.DecodeTo(data, rgba, 0, new WebpDecodeOptions { Multithreaded = true });

Decode every frame into a full-canvas RGBA buffer:

WebpAnimation animation = WebpDecoder.DecodeAnimation(data);
foreach (WebpFrame frame in animation.Frames)
{
    Console.WriteLine($"{frame.TimestampMs} ms: {frame.DurationMs} ms");
    byte[] rgba = frame.Rgba;
}

For on-demand playback, seek to the next frame to produce, then decode it:

var decoder = new WebpAnimationDecoder(data);
decoder.Seek(12);
byte[] canvas = new byte[decoder.CanvasWidth * decoder.CanvasHeight * 4];
if (decoder.TryDecodeNextFrame(canvas, out WebpFrameInfo frameInfo))
{
    Console.WriteLine($"Displayed frame {frameInfo.Index}");
}

The decoder is spec-derived from RFC 6386 / RFC 9649; libwebp/libvpx source was not consulted — their binaries are used only as test oracles.

Known oracle divergence: anim-vp8l-alpha-hint.webp has a VP8L animation frame with transparent decoded pixels despite a cleared alpha_is_used hint. The RFC 9649 blend flag requires alpha blending, which this decoder follows; anim_dump 1.6.0 emits that frame uncomposited. It is excluded from the anim_dump comparison but remains covered by compositing and seek-versus-sequential tests.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Sdcb.SimdCodecs.Webp:

Package Downloads
Sdcb.SimdCodecs

Image-codec facade over the Sdcb.SimdCodecs family: sniff a byte stream's format by its magic-byte signature and dispatch to the matching decoder (PNG, JPEG, TIFF, JBIG2, JPEG 2000, WebP, GIF, BMP, ICO, CUR, QOI, PBM / PGM / PPM / PAM, PFM), returning a codec-neutral IDecodedImage (fidelity tier: native bit depth + ColorEncoding colour signalling, with a ToFloats() RGBA float32 view) or decoding zero-copy into a caller-provided 8-bit RGBA buffer (display tier, integer-sample formats). AOT-compatible.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 0 10/30/2026
1.1.0 0 10/30/2026
1.0.1 52 10/29/2026