AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Converting webp converter3/16/2023 ![]() ![]() Gmagick PHP extension compiled with WebP support Imagick PHP extension compiled with WebP support WebPConvert currently supports the following converters: ConverterĮxec() function and that the webserver user has permission to run cwebp binary Stacks within stacks are supported (not really needed, though). The main convert method actually calls this converter. Stack takes a stack of converters and tries it from the top, until success. Requirements: A key to the EWWW Image Optimizer cloud service. Also, unfortunately, eAs with wpc, beware of upload limits. EAs lossless cannot be controlled, the "lossless:auto" option cannot be used for automatically trying both lossy and lossless and picking the smallest file. The service can be installed directly or by using this Wordpress pluginĮIt supports lossless encoding, but this cannot be controlled. ![]() Requirements: Access to a running service. The converter checks your php.ini settings and abandons upload right away, if an image is larger than your upload_max_filesize or your post_max_size setting. Btw: Beware that upload limits will prevent conversion of big images. To use it, you must either install webp-convert-cloud-service directly on a remote server, or install the Wordpress plugin, WebP Express in Wordpress. Wpc is an open source cloud service for converting images to webp. Requirements: GD PHP extension compiled with WebP support. ![]() It does not support any webp options, and does not support stripping metadata. The Gd extension is pretty common, so the main feature of this converter is that it may work out of the box. Gd uses the Gd extension to do the conversion. Requirements: Gmagick PHP extension compiled with WebP support. Requirements: Imagick PHP extension compiled with WebP support As the other converters lends this capability from Imagick, this is however no reason for using Imagick rather than the other converters. This enables it to automatically use same quality for destination as for source, which eliminates the risk of setting quality higher for the destination than for source (the result of that is that the file size gets higher, but the quality remains the same). Imagick has a very nice feature - that it is able to detect the quality of a jpeg file. Imagick does not support any special webp options, but is at least able to strip all metadata, if metadata is set to none. Vips is great! It offers many webp options, it is fast and installation is easier than imagick and gd, as it does not need to be configured for webp support. Vips ( new in 2.0) works by using the vips extension, if available. Of course, as we here have to call a binary directly, cwebp requires the exec function to be enabled, and that the webserver user is allowed to execute the cwebp binary (either at known system locations, or one of the precompiled binaries, that comes with this library). Setting this to max, we can squeeze the images a few percent extra - without loosing quality (the converter is still pretty fast, so in most cases it is probably worth it). We for example have the method option, which controls the trade off between encoding speed and the compressed file size and quality. However, with cwebp, we have more parameters to tweak than with the rest. Which again means that the results using the different methods are very similar. The eIf multiple big images needs to be converted at the same time, eThat library is actually the only library in town for generating webp images, which means that the other conversion methods ultimately uses that very same library. A 2 MB image takes ~5 seconds to convert (only 16% longer than my cwebp). eA 1MB image however only takes ~4.5 seconds to upload, convert and download (1.5 seconds longer). gmagick are third place, ~8% slower than cwebp. gd is right behind, merely 3% slower than cwebp. Anyway, here are the results: cweb is the fastest (with method=3). Speed-wise, there is too little difference for it to matter, considering that images usually needs to be converted just once. Read more about those considerations in the API. However, with cwebp, you can specify the desired reduction (the size-in-percentage option) - at the cost of doubling the conversion time. There is however one thing to take note of, if you set quality to auto, and your system cannot determine the quality of the source (this requires imagick or gmagick), and you do not have access to install those, then the only way to get quality-detection is to connect to a wpc cloud converter. This means that it does not matter much, which conversion method you use. All conversion methods below ultimately uses that very same library for conversion. When it comes to webp conversion, there is actually only one library in town: libwebp from Google. The webp converters The converters at a glance ![]()
0 Comments
Read More
Leave a Reply. |