module CrImage::Format::WebP
Overview
Provides methods to read from and write to WebP. Requires libwebp
to function.
image = File.open("image.webp") { |file| CrImage::RGBAImage.from_webp(file) }
File.open("other_image.webp") { |file| image.to_webp(file) }
Alternatively, you can use the convenience methods in the Open
and Save
modules
to acheive the same thing:
image = CrImage::RGBAImage.open("image.webp")
image.save("other_image.webp")
Direct including types
Defined in:
lib-formats/webp.crInstance Method Summary
-
#to_webp(io : IO, *, lossy : Bool = false, quality : Int32 = 100) : Nil
Write image to
io
using WebP encoding
Instance Method Detail
Write image to io
using WebP encoding