> ## Content Index
> Fetch the complete content index at: https://www.sakashita.page/llms.txt
> Use this file to discover other available public pages before exploring further.

# Pure Rust Webp Implementation
- URL: https://www.sakashita.page/pure-rust-webp-implementation/
- Published: 2026-07-18T00:30:08.000Z
- Updated: 2026-07-18T00:30:08.000Z
- Author: Sakashita Yasunobu
- Tags: 技術

webpをPure Rustで実装しました。

[GitHub - P4suta/webpkit: Pure-Rust WebP codec (VP8L lossless + VP8, encoder & decoder, no\_std, forbid-unsafe)Pure-Rust WebP codec (VP8L lossless + VP8, encoder & decoder, no\_std, forbid-unsafe) - P4suta/webpkit![](https://storage.ghost.io/c/94/1f/941f9972-ad5c-4231-a438-ca329c85433f/content/images/icon/favicon-42b9d8b5-a3a9-403b-be4a-22974594905d.svg)GitHubP4suta![](https://storage.ghost.io/c/94/1f/941f9972-ad5c-4231-a438-ca329c85433f/content/images/thumbnail/webpkit-62b626b9-6162-4f91-8b74-9bdcbe6be342)](https://github.com/P4suta/webpkit)

<https://crates.io/crates/webpkit>

libwebpよりも使いやすく、モダンな作りになっています。

`no_std`など、汎用的に使えると思います。

Rustで実装をする以上、unsafeがあると意味が薄れてしまいますので、本実装ではunsafeはありません。

また、ちょっとしたことですし、webpに限ったことじゃないのですが、webpにおけるデファクトであるlibwebpではメタデータがデフォで捨てられます。画像ライブラリにとっての至上命題は画像ファイルを小さくすることであり、メタデータだってデータなわけで捨てたほうが当然ファイル容量は削減できるので当然といえば当然であり、ことwebpなどのモダンな画像コーデックとしてはプライバシーという名目で捨てたほうがむしろ合理的ともいえます。一方で、メタデータの中にはexifだけでなくカラープロファイルなどのデータなどもあり利用者としては勝手に捨てられると困るデータもあるわけで、やや標準から外れますが、本実装ではメタデータは標準で捨てない設計としております。