DataDungeon::WebP
Constants
QUALITY = 85_f32
Class methods
In-place conversion: writes .webp sibling, deletes the original, returns new path.
Decode a PNG file to raw RGBA pixels: {width, height, rgba_bytes}. Through ImageProbe's reader, which turns a bad file into an error; libpng's own reader, used here before 0.16.2, aborted the process.
Convert a PNG file to WebP. Returns the new .webp path.
encode_webp(rgba : Bytes, width : Int32, height : Int32, webp_path : String, quality : Float32 = QUALITY) : Int64
Encode RGBA pixels to a WebP file. Returns output file size in bytes.
Encode RGBA pixels to WebP in memory. Returns the encoded bytes.