Import std.image.webp
WebP
struct
Public Struct WebP
What reads and writes WebP images, in its Static Methods.
Examples
Local image = Image(8, 8)
image.Fill(Color32.Orange)
Local lossless = Try WebP.Decode(WebP.EncodeLossless(image))
Expect(lossless[4, 4] == Color32.Orange)
Local lossy = Try WebP.Decode(WebP.Encode(image, 90))
Expect(lossy.Width == 8)-
@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 early, 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.