<?xml version='1.0' encoding='US-ASCII'?>

<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<rfc
      xmlns:xi="http://www.w3.org/2001/XInclude"
      category="std"
      docName="draft-zern-webp-00"
      ipr="trust200902"
      obsoletes=""
      updates=""
      submissionType="IETF"
      consensus="true"
      xml:lang="en"
      tocInclude="true"
      tocDepth="4"
      symRefs="true"
      sortRefs="true"
      version="3">

 <front>
   <title>WebP Image Format</title>
   <seriesInfo name="Internet-Draft" value="draft-zern-webp-00" />
   <seriesInfo status="standard" name="" value="draft-zern-webp-00" />

   <author fullname="James Zern" initials="J." surname="Zern">
     <organization>Google LLC</organization>
     <address>
       <postal>
         <street>1600 Amphitheatre Parkway</street>
         <city>Mountain View</city>
         <region>CA</region>
         <code>94043</code>
         <country>United States of America</country>
       </postal>
       <phone>+1 650 253-0000</phone>
       <email>jzern@google.com</email>
     </address>
   </author>

   <date year="2021" />

   <area>General</area>
   <workgroup>Internet Engineering Task Force</workgroup>

   <keyword>VP8</keyword>
   <keyword>WebP</keyword>

   <abstract>
   <t>WebP is a RIFF-based image file format which supports lossless and lossy
     compression as well as alpha (transparency) and animation. It covers use
     cases similar to JPEG, PNG and GIF.</t>
   </abstract>
 </front>

 <middle>
   <section numbered="true" toc="default">
     <name>Introduction</name>
     <t>This document provides references for the WebP image format and
       considerations for its use across platforms.</t>

     <t>WebP is a <xref target="riff-spec">Resource Interchange File Format
       (RIFF)</xref> based image file format
       <xref target="webp-riff"/> which supports lossless and lossy compression
       as well as alpha (transparency) and animation. It covers use cases
       similar to <xref target="jpeg-spec">JPEG</xref>,
       <xref target="RFC2083">PNG</xref> and the
       <xref target="gif-spec">Graphics Interchange Format (GIF)</xref>.</t>
     <t>WebP consists of two compression algorithms used to reduce the size of
       image pixel data, including alpha (transparency) information. Lossy
       compression is achieved using VP8 intra-frame encoding
       <xref target="RFC6386"/>. The lossless algorithm
       <xref target="webp-lossless"/> stores and restores the pixel values
       exactly, including the color values for zero alpha pixels. The format
       uses subresolution images, recursively embedded into the format
       itself, for storing statistical data about the images, such as the
       used entropy codes, spatial predictors, color space conversion, and
       color table. <xref target="lz77">LZ77</xref>,
       <xref target="huffman">Huffman coding</xref>, and a color cache are used
       for compression of the bulk data.</t>
   </section>

   <section anchor="webp-media-type" numbered="true" toc="default">
     <name>The 'image/webp' Media Type</name>
     <t>This section contains the media type registration details as per <xref
       target="RFC6838"/>.</t>
     <section numbered="true" toc="default">
       <name>Registration Details</name>
       <t>Media type name: image</t>
       <t>Media subtype name: webp</t>
       <t>Required parameters: N/A</t>
       <t>Optional parameters: N/A</t>
       <t>Encoding considerations: Binary. The <xref target="RFC4648">Base64
         encoding</xref> should be used on transports that cannot accommodate
         binary data directly.</t>
       <t>Security considerations: See <xref target="Security"/> below.</t>
       <t>Interoperability considerations: See <xref target="Interop"/>
         below.</t>
       <t>Applications which use this media type: Anywhere image size is an
         issue.</t>
       <t>Fragment identifier considerations: N/A</t>
       <t>Restrictions on usage: N/A</t>
       <t>Additional information:</t>
       <ul empty="true" spacing="normal">
         <li>Deprecated alias names for this type: N/A</li>
         <li>Magic number(s): The first 4 bytes are 0x52, 0x49, 0x46, 0x46
           ('RIFF'), followed by 4 bytes for the RIFF chunk size. The next 7
           bytes are 0x57, 0x45, 0x42, 0x50, 0x56, 0x50, 0x38 ('WEBPVP8').</li>
         <li>File extension(s): webp</li>
         <li>Macintosh file type code: UTTypeWebP com.google.webp</li>
         <li>Object Identifiers: N/A</li>
       </ul>
     </section>
   </section>

   <section anchor="Security" numbered="true" toc="default">
     <name>Security Considerations</name>
     <t>Security risks are similar to other media content and may include
       buffer overruns and uninitialized data usage as part of the demuxing
       and decoding process <xref target="cve.mitre.org-libwebp"/>
       <xref target="crbug-security"/>.</t>
   </section>

   <section anchor="Interop" numbered="true" toc="default">
     <name>Interoperability Considerations</name>
     <t>The format is defined using little-endian byte ordering (see
       <xref target="RFC2781" section="3.1"/>), but demuxing and decoding are
       possible on platforms using a different ordering with the appropriate
       conversion.

       The container is RIFF-based and allows extension via user defined
       chunks, but nothing beyond the chunks defined by the container format
       <xref target="webp-riff"/> are required for decoding of the image.</t>
   </section>

   <section anchor="IANA" numbered="true" toc="default">
     <name>IANA Considerations</name>
     <t>IANA has updated the "Image Media Types" registry to include
       'image/webp' as described in <xref target="webp-media-type"/>.</t>
   </section>
 </middle>

 <back>
   <references>
     <name>References</name>
     <references>
       <name>Normative References</name>
       <?rfc include="reference.RFC.2781.xml" ?>
       <?rfc include="reference.RFC.4648.xml" ?>
       <?rfc include="reference.RFC.6838.xml" ?>
     </references>

     <references>
       <name>Informative References</name>
       <?rfc include="reference.RFC.2083.xml" ?>
       <?rfc include="reference.RFC.6386.xml" ?>

       <reference anchor="crbug-security"
         target="https://bugs.chromium.org/p/webp/issues/list?q=label%3ASecurity">
         <front>
           <title>libwebp Security Issues</title>
           <author>
             <organization/>
           </author>
         </front>
       </reference>

       <reference anchor="cve.mitre.org-libwebp"
         target="https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=libwebp">
         <front>
           <title>libwebp CVE List</title>
           <author>
             <organization/>
           </author>
         </front>
       </reference>

       <reference anchor="gif-spec"
         target="https://www.w3.org/Graphics/GIF/spec-gif89a.txt">
         <front>
           <title>GIF89a Specification</title>
           <author>
             <organization/>
           </author>
         </front>
       </reference>

       <reference anchor="huffman">
         <front>
           <title>A Method for the Construction of Minimum Redundancy
             Codes</title>
           <seriesInfo name="Proceedings of the Institute of Radio Engineers"
             value="Number 9, pp. 1098-1101."/>
           <author initials="D. A." surname="Huffman">
             <organization/>
           </author>
           <date month="September" year="1952" />
         </front>
       </reference>

       <reference anchor="jpeg-spec"
         target="https://www.w3.org/Graphics/JPEG/itu-t81.pdf">
         <front>
           <title>JPEG Standard (JPEG ISO/IEC 10918-1 ITU-T Recommendation
             T.81)</title>
           <author>
             <organization/>
           </author>
         </front>
       </reference>

       <reference anchor="lz77">
         <front>
           <title>A Universal Algorithm for Sequential Data Compression</title>
           <seriesInfo name="IEEE Transactions on Information Theory"
             value="Vol. 23, No. 3, pp. 337-343."/>
           <author initials="J." surname="Ziv">
             <organization/>
           </author>
           <author initials="A." surname="Lempel">
             <organization/>
           </author>
           <date year="1977" month="May" />
         </front>
       </reference>

       <reference anchor="riff-spec"
         target="http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf">
         <front>
           <title>Multimedia Programming Interface and Data Specifications
             1.0</title>
           <author>
             <organization/>
           </author>
         </front>
       </reference>

       <reference anchor="webp-lossless"
         target="https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification">
         <front>
           <title>WebP Lossless Bitstream Specification</title>
           <author initials="J." surname="Alakuijala"
             fullname="Jyrki Alakuijala">
             <organization>Google LLC</organization>
           </author>
           <date month="September" year="2014" />
         </front>
       </reference>

       <reference anchor="webp-riff"
         target="https://developers.google.com/speed/webp/docs/riff_container">
         <front>
           <title>WebP RIFF Container</title>
           <author>
             <organization>Google LLC</organization>
           </author>
           <date month="April" year="2018" />
         </front>
       </reference>
     </references>
   </references>
   <!-- Change Log

v00 2021-04-29  JWZ   Initial version
   -->
 </back>
</rfc>
