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.cr

Instance Method Summary

Instance Method Detail

def to_webp(io : IO, *, lossy : Bool = false, quality : Int32 = 100) : Nil #

Write image to io using WebP encoding


[View source]