WebP (.webp)

Background

    Registered MIME type: image/webp
    WebP raster image format.
    Binary format.
    Stores a single image.
    Stores color bitmaps at a resolution of 8 bits per channel.
    Supports alpha channels.
    Introduced in 2010 by Google to provide both lossy and lossless compression of images on the web.

Import and Export

  • Import["file.webp"] imports a WebP file as an image.
  • Import["file.webp",elem] imports the specified element from a WebP file.
  • The import format can be specified with Import["file","WebP"] or Import["file",{"WebP",elem,}].
  • Export["file.webp",expr] exports an image, graphics, or any other expression as a raster image to WebP.
  • When exporting Wolfram Language graphics or arbitrary expressions to WebP, the resulting image has the same raster size as its displayed form.
  • Image objects are by default exported at their raster size.
  • Because WebP is a raster image format, all fonts are rasterized on export.
  • See the reference pages for full general information on Import and Export.
  • ImportString and ExportString support the WebP format.

Elements

  • General Import elements:
  • "Elements" list of elements and options available in this file
    "Rules"full list of rules for each element and option
    "Options"list of rules for options, properties, and settings
  • Data representation elements:
  • "Data"array of color values
    "Graphics"Graphics object representing an image
    "Image"raster image, given as an Image object
    {"Thumbnail",size}thumbnail of a given size (default size = Small)
  • Import and Export by default use the "Image" element for WebP files.
  • Advanced Import elements:
  • "BitDepth"bits used to represent each color channel in the file
    "Channels"the number of color channels used in the file
    "ColorProfileData"embedded color profile, given as a ColorProfileData object
    "ColorSpace"color encoding used in the file
    "ImageSize"raster dimensions
    "Summary"summary of the file

Options

  • Import and Export option:
  • ImageSizeAutomaticoverall image size
    "ImageTopOrientation"Automaticorientation of the image as stored in the file
  • Export option:
  • "CompressionLevel"0compression level, given as a number between 0 and 1

Examples

open allclose all

Basic Examples  (4)

Import a WebP file:

In[2]:=
Click for copyable input
Out[2]=

Summary of an image:

In[1]:=
Click for copyable input
Out[1]=

Export an image to WebP:

In[1]:=
Click for copyable input
Out[1]=

Export arbitrary inline graphics to WebP:

In[1]:=
Click for copyable input
Out[1]=

Scope  (2)

Import Elements  (13)

Import Options  (2)

Export Options  (3)

See Also

"PNG"  "GIF"  "JPEG"  "BMP"  "PBM"  "TIFF"  "ICC"

Tutorials

Introduced in 2014
(10.0)
| Updated in 2016
(11.0)