A New Format for Lossless and Lossy Image Compression

Lossless webp images are 26% smaller in size compared to PNG. Lossy webp images are 25-34% smaller in size compared to JPEG. This package reads and writes webp images into a 3 (rgb) or 4 (rgba) channel bitmap array using conventions from the 'jpeg' and 'png' packages.


A New Format for Lossless and Lossy Image Compression

Build Status AppVeyor Build Status Coverage Status CRAN_Status_Badge CRAN RStudio mirror downloads webp images are 25-34% smaller in size compared to JPEG. This package reads and writes webp images into a 3 (rgb) or 4 (rgba) channel bitmap array using conventions from the 'jpeg' and 'png' packages.

Hello World

# Convert to webp
library(png)
img <- readPNG(system.file("img", "Rlogo.png", package="png"))
write_webp(img, "rlogo.webp")
browseURL("rlogo.webp")
rm(img)
 
# Convert from webp
library(jpeg)
img <- read_webp("rlogo.webp")
writeJPEG(img, "rlogo.jpeg")
browseURL("rlogo.jpeg")

Installation

Binary packages for OS-X or Windows can be installed directly from CRAN:

install.packages("webp")

Installation from source on Linux or OSX requires libwebp. On Debian or Ubuntu install libwebp-dev:

sudo apt-get install -y libwebp-dev

On Fedora we need libwebp-devel:

sudo yum install libwebp-devel

On CentOS / RHEL we install libwebp-devel via EPEL:

sudo yum install epel-release
sudo yum install libwebp-devel

On OS-X use webp from Homebrew:

brew install webp

News

0.4

  • Fix autobrew for OSX Mavericks

0.3

  • Windows: update libwebp to v0.6.0
  • Add symbol registration
  • Extract autobrew from configure

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("webp")

0.4 by Jeroen Ooms, 2 years ago


https://github.com/jeroen/webp#readme https://developers.google.com/speed/webp


Report a bug at https://github.com/jeroen/webp/issues


Browse source code at https://github.com/cran/webp


Authors: Jeroen Ooms


Documentation:   PDF Manual  


MIT + file LICENSE license


Suggests jpeg, png

System requirements: libwebp


Suggested by magick, pdftools, rsvg.


See at CRAN