WebP library for C#

Nime Cloud picture Nime Cloud · Sep 27, 2011 · Viewed 20.8k times · Source

It seems like there is no code samples for WebP in C#. Is there any? I don't need to display WebP images directly but saving & transferring as WebP would be nice.

Answer

Deano picture Deano · Nov 5, 2012

Take a look at http://webp.codeplex.com/. There is a library that allows you to easily encode into WebP format. Check out this question for more information:

Convert Bitmap to WebP Image?

The library allows you to save into WebP format like so:

using (Image image = Image.FromFile("image.jpg"))
{
   Bitmap bitmap = new Bitmap(image);
   WebPFormat.SaveToFile("image.webp", bitmap);
}