Import std.image.webp
std.image.webp
WebP, over libwebp: WebP.Decode reads a still WebP, lossy or lossless, with or without alpha, and Encode writes a lossy one at a quality, and EncodeLossless a lossless one at an effort, which keeps every pixel as it is, the colors of transparent ones too. An animated WebP isn't read.
std/image/webp.fb
Types
WebP
struct
Public Struct WebP
What reads and writes WebP images, in its Static Methods.
-
@PanicsAtCaller Public Static Method Decode(data: UInt8[], limit: Int = MOST_PIXELS): Image Throws IOErrorstatic method #The image in
data, a still WebP. Throws an IOError of INVALID_DATA when thedataisn't a WebP or is broken, UNEXPECTED_END when it ends too soon, and OTHER when it's animated or the image has more pixels thanlimit. Panics when thelimitis negative. -
@PanicsAtCaller Public Static Method Encode(image: Image, quality: Int = 75): UInt8[]static method #The lossy WebP of the
imageatquality, from 0 to 100, its alpha kept losslessly. Panics when thequalityis another, or theimagehas no pixels or a side longer than 16383. -
@PanicsAtCaller Public Static Method EncodeLossless(image: Image, effort: Int = 6): UInt8[]static method #The lossless WebP of the
image, ateffort, from 0, the fastest, to 9, the smallest. Panics when theeffortis another, or theimagehas no pixels or a side longer than 16383.
Report an issue with this page or with FutureBlitz on GitHub.