rosell-dk / webp-express

Wordpress plugin for serving autogenerated WebP images instead of jpeg/png to browsers that supports WebP
GNU General Public License v3.0
221 stars 63 forks source link

Enhancement: Convert to webp from full-sized jpegs #588

Open Forza-tng opened 1 year ago

Forza-tng commented 1 year ago

WordPress generates several sizes of of uploaded files. When converting them to webp, webp-express, uses each resized image as source when converting to webp. This means that jpeg encoding errors are kept in the webp target and that webp files can never look better than their jpeg counterparts

webp-express could achieve better quality by using the original large source file and do scaling during the encoding. This way we end up with smaller webp files while retaining better visual quality.

Examples:

cwebp -mt -resize 1024 768 -m6 source.jpg
magick source.jpg -filter Lanczos -distort Resize 1024x768