Skip to content
WebP high-level API for dlib's SuperImage.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
source/dlibwebp
.gitignore
.travis.yml
LICENSE.txt
README.md
dub.json
travis-ci.sh
workspace.dlangidews

README.md

Dub version Build Status Coverage Status

Testing

dub test --debug=featureTest

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/LICENSE_1_0.txt

Dependencies:

  • libwebp BSD 3-clause
  • dlib Boost Software License, Version 1.0
  • feature-test-d (for testing) MIT
  • random-dlib-image (for testing) Boost Software License, Version 1.0
You can’t perform that action at this time.