NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #2956 most downloaded on Packagist
Convert JPEG & PNG to WebP with PHP
Latest stable
2.9.5
Last release 5 months ago
18 Jun 2026
Release timing varies
gaps range from 2 weeks to 2.2 years
Some releases are documented
notes for 25 of 46 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
49 releases · first in 2018
Drag across the ruler to compare, or tap a release to open it.
Removed deprecated Curl calls for PHP 8.5 / 8.5 - PR provided by @hostep #359
WPC converter uses curl underneath to make the api call. However, the curl library out of the box allows protocols that can be unsafe, such as "file:"
WPC converter uses curl underneath to make the api call. However, the curl library out of the box allows protocols that can be unsafe, such as "file:" This release blocks specifically configures curl only to allow http and https.
Also added "require-public-ip" option to WPC (defaults to false). Setting it to true can further improve the security of WPC converter, by rejecting api urls on private IP (such as localhost or 127.0.0.1). Only relevant if somehow non-trusted people can gain access to set the api-url
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Ewww stopped working because the ewww api changed the content-type in the response. This update works with the changed api (as well as the old, in cas
Ewww stopped working because the ewww api changed the content-type in the response. This update works with the changed api (as well as the old, in case ewww should decide to revert the change)
Changes: https://github.com/rosell-dk/webp-convert/milestone/29?closed=1
Bumped image-mime-type-guesser to 1.1.1 (fixes a bug in the mime mapper)
Also extracted some code into new repositories:
Nothing published for this version
When exec() is unavailable, alternatives are now tried (emulations with proc_open(), passthru() etc). Using this library to do it.
The part of the log that displays the options are made more readable. It also now warns about deprecated options.
WebPConvert::getConverterOptionDefinitions()ImageMagick now supports the "near-lossless" option (provided Imagick >= 7.0.10-54)
minor:
https://github.com/rosell-dk/webp-convert/milestone/24?closed=1
Introduced auto-limit option which replaces setting "quality" to "auto" #281.
You can now use webp-convert with PHP 8.
You can now use webp-convert with PHP 8.
Note: In order to have the unit tests working in PHP 8, an update to a newer version of PHPUnit was required (minimum 9.3 for PHP8 support). As PHPUnit 9.3 requires at least PHP 7.3, the requirements for dev is now PHP 7.3. But just dev - the library still works in PHP 7.2, 7.1, 7.0 and 5.6. The travis configuration has been tweaked a bit in order to still have unit tests run on those older PHP versions (PHP 8.0, PHP 7.4, PHP 7.2 and PHP 5.6 are currently tested on travis-ci)
Other:
A new conversion method is available: ffmpeg. It works by executes ffmpeg binary if available on host. It is no match for cwebp, vips and imagick, as
A new conversion method is available: ffmpeg. It works by executes ffmpeg binary if available on host. It is no match for cwebp, vips and imagick, as it only have a few options. But it seems to be generally more available than these. It however supports encoding (specifying lossless / lossy), "method" and "preset", which makes it a better choice than Gd.
Also, the cwebp binaries have been bumped to 1.1.0 (from 1.0.3), and there have been some minor bug fixes.
Check out the milestone for all changes: https://github.com/rosell-dk/webp-convert/milestone/20?closed=1
The cwebp converter used the file permissions of the destination folder for the new converted file. It now takes the file permissions of the file that
Nothing published for this version
Bugfix: Dots and permissions of binaries can cause trouble
Nothing published for this version
These fixes makes Cwebp work on more systems.
These fixes makes Cwebp work on more systems.
cwebp command wasn't tried (due to a bug)As always, check out the corresponding milestone for more details
Destination is now required to end with ".webp"
Nothing published for this version
Quality detection could sometimes return 0
Fixed some bugs:
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
*Note: Paths containing directory traversing ("../") are now rejected*
Note: Paths containing directory traversing ("../") are now rejected
Nothing published for this version
Nothing published for this version
NOTE: This release actually contains an api-breaking change!
NOTE: This release actually contains an api-breaking change!
I decided not increasing major version because probably only few has started using this feature and I wish not increase major version this soon after 2.0.
The release also contains these fixes:
And this feature:
Nothing published for this version
Nothing published for this version
This major release started out with the simple wish to have a common base class for the converters. As one should hold back on major releases, I ended
This major release started out with the simple wish to have a common base class for the converters. As one should hold back on major releases, I ended up going critically through the whole library, resulting in a lot of internal code changes and some API changes. As many changes increases risk of new bugs, I have also written a lot of test cases, I have doc-commented the entire library, and I have started using Scrutinizer and phpstan to help find problems.
Highlights of this release:
For a better introduction to the new features, I suggest that you read the new conversion introduction.
If you are migrating from version 1.3.9, I suggest you read this
This major release started out with the simple wish to have a common base class for the converters. As one should hold back on major releases, I ended
This major release started out with the simple wish to have a common base class for the converters. As one should hold back on major releases, I ended up going critically through the whole library, resulting in a lot of internal code changes and some API changes. As many changes increases risk of new bugs, I have also written a lot of test cases, I have doc-commented the entire library, and I have started using Scrutinizer and phpstan to help find problems.
Highlights of this release:
For a better introduction to the new features, I suggest that you read the new conversion introduction.
If you are migrating from version 1.3.9, I suggest you read this
Cwebp under some circumstances creates an empty file. This is now handled as an error.
Cwebp under some circumstances creates an empty file. This is now handled as an error.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Uses escapeshellarg for source and destination arguments for binary converters (instead of custom function) and quality detection
Gd failed converting images that was not true color. And it had issues with transparency.
Gd failed converting images that was not true color. And it had issues with transparency.
See issue #42
Nothing published for this version
Nothing published for this version
Fixed two bugs: 1: An uncaught ImagickException could happen when detecting quality of jpeg, and Imagick was compiled without jpeg support 2: cwebp co
Fixed two bugs: 1: An uncaught ImagickException could happen when detecting quality of jpeg, and Imagick was compiled without jpeg support 2: cwebp converter could not handle spaces in filenames.
Actually, there is also a new feature in this release: a new converter "imagickbinary". But it is not official, because it has not been tested thoroughly. Schhh!
Nothing published for this version
Nothing published for this version
The major new addition in this release is that two libraries that was based on webp-convert is now part of webp-convert.
The major new addition in this release is that two libraries that was based on webp-convert is now part of webp-convert.
The addition of the "webp-convert-and-serve" library means that webp-convert now is able to <i>serve</i> the images it converts as well as handle errors in customized ways.
The addition of webp-on-demand mostly means the addition of documentation on how to set up a solution for serving autogenerated webp-images to browsers that supports the webp format. But additional effort has been taken to make the task of serving already existing converted images as quick as possible.
One could argue that these additions should trigger a 2.0.0 version. However, care has been taken to maintain compatibility. The good old API still works, it has however been extended.
Besides these additions, there are good news regarding Imagick. It wasn't generating impressive webp images. But now, the conversions are on par with the other converters.
Also, say welcome to a new converter in our family: gmagick - which depends on the gmagick extension being available. Actually it is quite straight-forward to get the gmagick extension working with webp support in Ubuntu 18.04 (see the wiki)
I have also added new options for cwebp. Noteably "command-line-options", which allows you to set any command line option that cwebp supports. "size-in-percentage" is also interesting. It sets the file size cwebp should aim for - in percentage of the original. Its a good alternative to quality:auto, when quality detection on the system isn't working (detecting jpeg quality requires imagick or gmagick)
Finally, ewww and wpc now examines upload limits before trying to send big files to the cloud
Nothing published for this version
The main new feature of this release is that quality now can be set to "auto". This avoids the pitfall of converting an image with low quality (say 40
The main new feature of this release is that quality now can be set to "auto". This avoids the pitfall of converting an image with low quality (say 40) into a webp of good quality (say 85), and thereby generating a webp file, which is larger than the original. As that pitfall defeats the whole purpose of generating webp files, it is quite important feature. For this reason also, the new default of "quality" is "auto".
Along with this change, a new "max-quality" option is introduced. This is in order to avoid generating images with excessive quality, due to the jpeg being of excessive quality. Generally 85 is more than enough for web, and file size increases radically on higher qualities. For this reason, max-quality is defaulted to 85
Another significant addition is the WPC converter. WPC is a cloud converter based on WebPConvert. It thus accepts all the options that WebPConvert has. If set up to run cwebp, it produces the best possible quality.
Another significant addition is the new $logger parameter, which enables insights into the conversion process.
Also, the individual converters now exposes metadata about the extra options. For example, Cwebp defines its options like this:
public static $extraOptions = [
[
'name' => 'use-nice',
'type' => 'boolean',
'sensitive' => false,
'default' => false,
'required' => false
],
];
This allows creating UI for configuring the converters in a generic manner. (#44).
Other changes:
There are other minor changes as well. Check the commit history, if you are curious.
The main new feature of this release is that quality now can be set to "auto". This avoids the pitfall of converting an image with low quality (say 40
The main new feature of this release is that quality now can be set to "auto". This avoids the pitfall of converting an image with low quality (say 40) into a webp of good quality (say 85), and thereby generating a webp file, which is larger than the original. As that pitfall defeats the whole purpose of generating webp files, it is quite important feature. For this reason also, the new default of "quality" is "auto".
Along with this change, a new "max-quality" option is introduced. This is in order to avoid generating images with excessive quality, due to the jpeg being of excessive quality. Generally 85 is more than enough for web, and file size increases radically on higher qualities. For this reason, max-quality is defaulted to 85
Another significant addition is the WPC converter. WPC is a cloud converter based on WebPConvert. It thus accepts all the options that WebPConvert has. If set up to run cwebp, it produces the best possible quality.
Another significant addition is the new $logger parameter, which enables insights into the conversion process.
Also, the individual converters now exposes metadata about the extra options. For example, Cwebp defines its options like this:
public static $extraOptions = [
[
'name' => 'use-nice',
'type' => 'boolean',
'sensitive' => false,
'default' => false,
'required' => false
],
];
This allows creating UI for configuring the converters in a generic manner. (#44).
Other changes:
There are other minor changes as well. Check the commit history, if you are curious.
This is quite a make-over of the 0.1.0 release
This is quite a make-over of the 0.1.0 release
Most importantly, 1.0.0 does not create any output. It just converts - if possible. If you want to serve the created image, take a look at webp-convert-and-serve.
Secondly, the API has changed slightly. Firstly, the convert signature has changed from convert($source, $destination, $quality, $stripMetadata) to convert($source, $destination, $options). Quality is now one optional option among many, which are set in $options. Gone are also all public properties and methods, but the convert method. This makes usage clean. And you don't risk that a configuration done in another place affects your current conversion. Reordering the converters is now done with the converters option in the $options
Lastly, but not least, the repository has matured a great deal. We have now unit tests, Travis CI integration and PSR-2 code compliance. These steps ensures stability and quality.
This is quite a make-over of the 0.1.0 release
This is quite a make-over of the 0.1.0 release
Most importantly, 1.0.0 does not create any output. It just converts - if possible. If you want to serve the created image, you will have to do that last piece of implementation yourself.
Secondly, the API has changed slightly. Firstly, the convert signature has changed from convert($source, $destination, $quality, $stripMetadata) to convert($source, $destination, $options). Quality is now one optional option among many, which are set in $options. Gone are also all public properties and methods, but the convert method. This makes usage clean. And you don't risk that a configuration done in another place affects your current conversion. Reordering the converters is now done with the converters option in the $options
Lastly, but not least, the repository has matured a great deal. We have now unit tests, Travis CI integration and PSR-2 code compliance. These steps ensures stability and quality.
Nothing published for this version
One column per quarter.