Skip to content

feat(webp)!: migrate WebP to gamut-webp - #60

Merged
justin13888 merged 2 commits into
masterfrom
feat/24-gamut-webp
Aug 5, 2026
Merged

feat(webp)!: migrate WebP to gamut-webp#60
justin13888 merged 2 commits into
masterfrom
feat/24-gamut-webp

Conversation

@justin13888

Copy link
Copy Markdown
Collaborator

Summary

  • replace the in-repo libwebp-sys FFI codec/mux wrapper with crates.io gamut-webp 0.3.1 for pure-Rust VP8/VP8L decode and encode
  • route WebP EXIF/XMP/ICC chunks through gamut-webp and gamut-metadata::MetadataBlock, removing the manual RIFF EXIF scanner
  • remove the C dependency, libwebp feature aliases, backend-specific error, and legal notice; publish webp/gamut at registry version 0.3
  • preserve interoperability with a tracked WebP fixture produced by the previous libwebp backend and add WebP encode/decode + metadata round-trip coverage

Breaking API changes

  • LibwebpDecodeConfigWebpDecodeConfig
  • LibwebpEncodeConfigWebpEncodeConfig
  • WebP quality changes from f32 to u8; the libwebp-only method and near_lossless fields are removed (future tuning remains upstream in gamut-webp: encoder knobs — effort/method and near-lossless gamut#261)
  • EncodeError::WebP, webp-decode-libwebp, and webp-encode-libwebp are removed

Performance

Full Criterion runs on the same Ryzen 7 7800X3D host, using the 512×512 synthetic lossy round trip at quality 75:

Benchmark libwebp 0.14.2 gamut-webp 0.3.1
encode 7.40 ms 9.97 ms
decode 766 µs 4.88 ms

The decode comparison uses each backend's own encoded output. These numbers are recorded in docs/BENCHMARKS.md as the new upstream-first baseline.

Validation

  • cargo test --workspace --features rawshift-image/full
  • cargo clippy --workspace --all-targets --features rawshift-image/full -- -D warnings
  • cargo doc --workspace --no-deps --features rawshift-image/full
  • cargo publish --dry-run -p rawshift-image
  • direction-only checks for webp-decode, webp-encode, and webp
  • full Criterion run for decode, demosaic, and pipeline benches (HEIC/AVIF hardware benches skipped cleanly because their external encoder tools are unavailable)

Closes #24

@justin13888
justin13888 merged commit 4db7419 into master Aug 5, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate WebP to gamut-webp

1 participant