/WebP.jl

Primary LanguageJuliaMIT LicenseMIT

WebP

Build Status Coverage Code Style: Blue

WebP.jl is a Julia library for handling WebP images. WebP provides both lossy and lossless compression of images, and may offer smaller file sizes compared to JPEG and PNG.

The core functionality of this package is supported by the libwebp C library.

Usage

This package provides functions for reading and writing WebP image files,

  • WebP.read_webp
  • WebP.write_webp

as well as functions for decoding and encoding WebP image data,

  • WebP.decode
  • WebP.encode

Reading and writing

An image may be written,

using TestImages
using WebP

image = testimage("lighthouse")
WebP.write_webp("lighthouse.webp", image)

and subsequently read,

image = WebP.read_webp("lighthouse.webp")

Decoding and encoding

An image may be encoded,

using TestImages
using WebP

image = testimage("lighthouse")
data = WebP.encode(image) # data is a Vector{UInt8}

and subsequently decoded,

image = WebP.decode(data)