Skip to content
This repository has been archived by the owner. It is now read-only.
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

Dub version Build Status Coverage Status

Testing

dub test --debug=featureTest

Usage

import dlib.image;
import dlibwebp;

void main() {
  auto img = loadPNG("input.png");

  // Medium quality.
  img.saveWEBP("quality.webp");

  img.saveWEBP("q50.webp", 50);

  img.saveWEBP("hq.webp", WEBPQuality.HIGH);

  // But it is still YUV 4:2:0.
  img.saveWEBP("q100.webp", WEBPQuality.HIGHEST);

  // And it is not.
  img.saveWEBP("lossless.webp", WEBPQuality.LOSSLESS);

  // You may want to use the streaming API
  // just like savePNG, saveTGA, etc.
  // auto res = img.saveWEBP(outputStream, 50);

  // Also, you can save to arrays:
  // ubyte[] lossy = img.saveWEBPToArray();
  // ubyte[] lossy50 = img.saveWEBPToArray(50);
  // ubyte[] lossless = img.saveWEBPToArray(WEBPQuality.LOSSLESS);

  // 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: