kornelski / cavif-rs

AVIF image creator in pure Rust
https://lib.rs/cavif
BSD 3-Clause "New" or "Revised" License
570 stars 27 forks source link

[Feature request]: Add webp format support for input images #74

Closed suphamster closed 1 year ago

suphamster commented 1 year ago

Since most of tools that supports it (imagemagick, nconvert, libvips, ffmpeg) are much slower than cavif (and avifenc).

kornelski commented 1 year ago

Lossy to lossy conversion is a bad idea. I don't want to encourage that. In the conversion you will be losing more quality than you're saving in file size.

WebP lossy only supports half-resolution color channels. This is a very old technique that AV1 has obsoleted, so I've deliberately haven't supported it in this tool. Even WebP saved with very high quality setting will have color smudged, and storing that distortion in AVIF is a waste of bits. AVIF's native chroma subsampling is not even fit for this, because it does not have defined upsampling, but WebP does.

OTOH WebP lossless is good and may even be better than AV1's lossless.

So I suggest if you already have WebP, leave it.