WebP library for C# [closed]
Asked Answered
S

4

13

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.

Sergeant answered 27/9, 2011 at 8:49 Comment(1)
Did you find anything for this?Chauchaucer
S
6

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);
}
Sealey answered 5/11, 2012 at 12:11 Comment(5)
is there something similar for java/android?Intelligence
This project looks abandoned...Plaza
Throwing format error.#43678338Hardship
Google Chrome doesn't shows the webpage because of security warning on the webp.codeplex.com link.Witness
I think that it is moved to: github.com/imazen/libwebp-netTrimetrogon
H
7

WebP-wrapper

Wrapper for libwebp in C#. The most complete wapper in pure managed C#. Exposes Simple Decoding API, Simple Encoding API, Advanced Encoding API (with compresion statistics), Get library version and WebPGetFeatures (info of any WebP file). In the future I´ll update for expose Advanced Decoding API. The wrapper is in safe managed code in one class. No need for external dll except libwebp_x86.dll and libwebp_x64.dll (included v6.1). The wrapper work in 32, 64 bit or ANY (auto swith to the apropiate library).

The code is full comented and include simple example for using the wrapper.

Honeysuckle answered 3/2, 2015 at 14:4 Comment(3)
I needed a way to convert .webp images to .jpg images and it works great.Thermodynamics
It doesn't work, just throws exception during WebPGetFeatures WebPGetFeaturesInternal_x64, impossible to debug further because it's a dLL, moreover the error message simply gives the name of the DLL file!Reeva
There is literally not a single example of anyone in the world trying to use this DLL in Unity C#.Reeva
S
6

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);
}
Sealey answered 5/11, 2012 at 12:11 Comment(5)
is there something similar for java/android?Intelligence
This project looks abandoned...Plaza
Throwing format error.#43678338Hardship
Google Chrome doesn't shows the webpage because of security warning on the webp.codeplex.com link.Witness
I think that it is moved to: github.com/imazen/libwebp-netTrimetrogon
S
5

there is a project in github

Wrapper for libwebp in C#. The most complete wrapper in pure managed C#.

Exposes Simple Decoding API and Encoding API, Advanced Decoding and Encoding API (with stadistis of compresion), Get version library and WebPGetFeatures (info of any WebP file). Exposed get PSNR, SSIM or LSIM distortion metrics.

The wrapper is in safe managed code in one class. No need external dll except libwebp_x86.dll and libwebp_x64.dll (included v6.1). The wrapper work in 32, 64 bit or ANY (auto swith to the apropiate library).

The code is full comented and include simple example for using the wrapper.

see project page: https://github.com/JosePineiro/WebP-wrapper

Slogan answered 4/8, 2018 at 5:37 Comment(0)
C
1

There is https://github.com/mc-kay/libwebp-sharp wrapper project. But it doesn't seem to be implemented.

Chauchaucer answered 7/11, 2011 at 15:0 Comment(1)
github.com/imazen/libwebp-netWitness

© 2022 - 2024 — McMap. All rights reserved.