You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seems like the towebp filter with quality 100 don't make lossless quality, compared to ImageMagick command.
When I use Timber with an original image at 381ko, Timber generate a 66ko image, ImageMagick a 232ko image.
The |towebp filter use the php 'imagewebp' function. Timber PHP
So I gues they just handle it different.
Your results should also be different with cwebp, gd, gmagick, ...
The difference of the size is very important, 66ko (Timber) versus 232ko (ImageMagick).
There is lossless parameter in the ImageMagick documentation, maybe PHP ignore this?
In PHP 8.1, the GD extension supports lossless encoding, and declares a new PHP constant IMG_WEBP_LOSSLESS which can be passed to imagewebp function to enable lossless encoding of a GdImage object.
TimberImage(my_image).src('full')|towebp(101) in the future?
Expected behavior
Timber WebP lossless quality is lossless quality.
Actual behavior
Seems like the
towebp
filter with quality 100 don't make lossless quality, compared to ImageMagick command.When I use Timber with an original image at 381ko, Timber generate a 66ko image, ImageMagick a 232ko image.
Original: https://www.dropbox.com/s/7evk7rrfqsbj6x9/original.png?dl=0
Timber WebP: https://www.dropbox.com/s/oj8gdqf6qnaqtjs/timber.webp?dl=0
ImageMagick WebP: https://www.dropbox.com/s/cgfgklf013xttg4/imagemagick.webp?dl=0
(Sorry for using Dropbox, Github doesn't support WebP upload)
Steps to reproduce behavior
Generate a WebP with Timber:
TimberImage(my_image).src('full')|towebp(100)
Generate a WebP with ImageMagick:
magick original.png -quality 100 generated.webp
The image is lossless with ImageMagick, not with Timber.
What version of WordPress, PHP and Timber are you using?
PHP 7.4 with Mamp Pro, Timber 1.19.1, WP 5.8.2.
Thanks!
The text was updated successfully, but these errors were encountered: