Skip to content

Latest commit

 

History

History
44 lines (28 loc) · 843 Bytes

File metadata and controls

44 lines (28 loc) · 843 Bytes

WebP.Net

What is this?

This library provides a simple encoder and decoder for webp.

How to use?

Install

In your csproj :

<PackageReference Include="WebP_Net" Version="2.0.3" />

Or, if you using .net cli :

dotnet add package WebP_Net --version 2.0.2

Encode / Decode

using System.Drawing;
using WebP.Net;

var bitmap = WebPDecoder.Decode(File.ReadAllBytes("..."));

using var webp = WebPEncoder.EncodeLossless(bitmap);
File.WriteAllBytes("...", webp.AsSpan().ToArray());

Get version

using WebP.Net;

var version = WebPLibrary.GetVersion();