dlib-webp 0.0.2

saveWEBP and loadWEBP from/to SuperImage. It has alpha channel and lossless compression support.


To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

<a href="https://code.dlang.org/packages/dlib-webp" title="Go to dlib-webp"><img src="https://img.shields.io/dub/v/dlib-webp.svg" alt="Dub version"></a>

Usage

import dlib.image;
import dlibwebp;

void main() {
  auto img = loadPNG("input.png");
  
  // 0 is the worst quality, 100 is the best.
  // But it is still YUV 4:2:0.
  img.saveWEBP(50, "quality50.webp");
  
  // And it is not.
  img.saveLosslessWEBP("lossless.webp");
  
  // You may want to use the streaming API
  // just like savePNG, saveTGA, etc.
  // auto res = img.saveWEBP(50, outputStream);
  
  // Also, you can save to arrays:
  // ubyte[] lossy = img.saveWEBPToArray(50);
  // ubyte[] lossless = img.saveLosslessWEBPToArray();
  
  // And back.
  auto readBack = loadWEBP("lossless.webp");
  readBack.savePNG("lossless.png");
  
  // Also available:
  // loadWEBP(inputStream)
  // loadWEBP(ubyte[])
}

License

Boost Software License, Version 1.0 http://www.boost.org/LICENSE10.txt

Dependencies:

  • libwebp BSD 3-clause
  • dlib Boost Software License, Version 1.0
  • random-dlib-image (for testing) Boost Software License, Version 1.0
Authors:
  • Георгий Устинов
Dependencies:
random-dlib-image, dlib, libwebp
Versions:
0.0.6 2017-Feb-08
0.0.5 2017-Feb-08
0.0.4 2017-Feb-03
0.0.3 2017-Feb-03
0.0.2 2017-Jan-31
Show all 7 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 13 downloads total

Score:
0.0
Short URL:
dlib-webp.dub.pm