Legal Questions on Reimplementing Single-File WebP Image Decoder

537 views
Skip to first unread message

Miku AuahDark

unread,
Dec 23, 2023, 3:02:51 AM12/23/23
to WebP Discussion
Hello,

I'm trying to write a reimplementation of WebP image decoder heavily based on libwebp. I'm inspired by other single-file libraries such as lodepng and stb_image in which they're easy to integrate in projects. Unfortunately said thing doesn't exist for WebP yet.

So far, I've implemented the VP8 lossy decoding stage with bit-exact result as libwebp for my own test image. Ultimately, the goal is to encompass full WebP support, including VP8L/lossless, alpha channels, and passing official tests (if available, subject to certain restrictions). However, for simplicity, animation and metadata parsing is out of scope of the project. It is also does not try to be performant decoder.

Before dedicating further time and effort, I have a few legal questions:

  1. Can I freely distribute the source code of my reimplementation?
  2. If so, would using a different license like zlib be permissible?
  3. How do WebP patents apply to my reimplementation?

Please do note that my project does not try to compete libwebp. If the developer needs any of these:
  • Encoding image to WebP;
  • Loading animation in WebP images;
  • Extracting metadata out of WebP images; or
  • If performant decoder is necessary
then developers are encouraged to use libwebp instead of my reimplementation.

Thank you for your understanding.

Yannis Guyon

unread,
Dec 23, 2023, 4:57:36 AM12/23/23
to WebP Discussion, Miku AuahDark
Thank you for reaching out and for your interest in the WebP format. Please find below my personal understanding of the topic.

1. Freely distributing the source code of your implementation depends on its license. libwebp's BSD-3-Clause license allows for open-source, free source code distribution. Please note that the WebP format is licensed differently, see here.
2. libwebp uses the BSD-3-Clause license so your implementation must retain the copyright and BSD-3-Clause license if your implementation copies with or without transformations some or all parts of libwebp. If adding another license on top of BSD-3-Clause is allowed, it will only add constraints and cannot grant more permissions in my opinion.
3. See libwebp's PATENTS and WebP's inherited WebM patent license.

To summarize:
- Keep the BSD-3-Clause license and copyright if any part of libwebp source code is used in your implementation. Also distribute the BSD-3-Clause license and copyright notice along your binaries if these were built with any link to libwebp.
- You may choose any other license if you implement a WebP decoder from scratch. You may consult the WebP specification and libwebp implementation to understand how the format is designed in order to develop and release your implementation.

Miku AuahDark

unread,
Dec 24, 2023, 4:54:58 AM12/24/23
to WebP Discussion, Yannis Guyon, Miku AuahDark
Hello, thank you for your kind response.

Since most part of my reimplementation code is heavily based on libwebp (but not linking to libwebp whatsover), that means I must keep my reimplementation under BSD-3. Is that right? As for the patent, while I get it that the patent is granted automatically, I'm not so sure if I should provide the same patent grant in my project. Should I do that?

Yannis Guyon

unread,
Dec 24, 2023, 5:08:22 AM12/24/23
to WebP Discussion, Miku AuahDark, Yannis Guyon
I believe you must keep your implementation under BSD-3, yes.
The PATENTS file does not seem to give you the right to grant the patent license from your name, so I am not so sure. I guess you can fork the whole libwebp repository and keep all legal files as is, so my understanding is that as long as Google remains the owner, it is fine (also keep the Copyright disclaimer).
Sorry for not being affirmative, please seek legal counsel if you need further help.

Miku AuahDark

unread,
Dec 25, 2023, 4:56:57 PM12/25/23
to WebP Discussion, Yannis Guyon, Miku AuahDark
Based on these conversation, I'll do the following for my reimplementation:
  1. License it under BSD-3, retaining Google Inc. as the original libwebp author.
  2. Have the patent grant under Google.
  3. To comply with single-file requirements, both the license and the patent grant is in single-file, at the end of the header file.
If there's any objection, I'll happy to discuss it further.

Thank you for your kind responses.
Reply all
Reply to author
Forward
0 new messages