PHPackages                             codeblog/conveter-php-webp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. codeblog/conveter-php-webp

ActiveLibrary[Image &amp; Media](/categories/media)

codeblog/conveter-php-webp
==========================

Easy WebP conversion library for PHP

v1.0.4(6y ago)124.1k1MITPHPPHP &gt;=7.1

Since Jul 2Pushed 6y ago1 watchersCompare

[ Source](https://github.com/whallysson/conveter-php-webp)[ Packagist](https://packagist.org/packages/codeblog/conveter-php-webp)[ Docs](http://www.codeblog.com.br)[ RSS](/packages/codeblog-conveter-php-webp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)DependenciesVersions (6)Used By (1)

ToWebP @Codeblog
================

[](#towebp-codeblog)

[![Maintainer](https://camo.githubusercontent.com/ba3200569409e72085b945f85a8f330b9cc2721bf789ab0d990b120d6b7998e0/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6d61696e7461696e65722d407768616c6c7973736f6e2d626c75652e7376673f7374796c653d666c61742d737175617265)](https://twitter.com/whallysson)[![Source Code](https://camo.githubusercontent.com/65365e943da0e511d4060b72124fafabc0a43bdfca10d1103d94578617b796fb/687474703a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d636f6465626c6f672f636f6e7665746572706870776562702d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/whallysson/conveter-php-webp)[![PHP from Packagist](https://camo.githubusercontent.com/99db95834a97c3f1a33b3620b481c74f4e427a1e3179c705f990567fd7fe55ba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f636f6465626c6f672f636f6e76657465722d7068702d776562702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codeblog/conveter-php-webp)[![Latest Version](https://camo.githubusercontent.com/b8b640370c9f5fcf0c352f17823d87beca338a5a338191ca1ab5c3ffdef91cc7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f7768616c6c7973736f6e2f636f6e76657465722d7068702d776562702e7376673f7374796c653d666c61742d737175617265)](https://github.com/whallysson/conveter-php-webp/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build](https://camo.githubusercontent.com/e053ead845aa8978a5de1832832f544da3c7e890d92dc17eab4a6600d9ea7508/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f6275696c642f672f7768616c6c7973736f6e2f636f6e76657465722d7068702d776562702e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/whallysson/conveter-php-webp)[![Quality Score](https://camo.githubusercontent.com/0a7740a31c6fc35bb23e49d865e7dddc3c05295f669c5ef2d0511270f074fc9f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7768616c6c7973736f6e2f636f6e76657465722d7068702d776562702e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/whallysson/conveter-php-webp)[![Total Downloads](https://camo.githubusercontent.com/d0098f850af7cb6f010047dabcfa2c7e3246c5eb9e3c3d3ed4557461ba8d4b93/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f6465626c6f672f636f6e76657465722d7068702d776562702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codeblog/conveter-php-webp)

###### ToWebP converts JPEG &amp; PNG files to WebP format. That is an image format developed by Google that promises to reduce the image file size by up to 39%.

[](#towebp-converts-jpeg--png-files-to-webp-format-that-is-an-image-format-developed-by-google-that-promises-to-reduce-the-image-file-size-by-up-to-39)

ToWebP faz a conversão de arquivos JPEG &amp; PNG para o formato WebP. Que é um formato de imagem desenvolvido pelo Google que promete reduzir o tamanho do arquivo de imagens em até 39%.

### Highlights

[](#highlights)

- Run the Cwebp binary directly via exec () (Executa o binário Cwebp diretamente via exec ())
- Compatible with the PHP GD extension (Compativel com a extensão PHP GD)
- Compatible with the PHP Imagick extension (Compativel com a extensão PHP Imagick)
- Validate images by mime-types (Valida de imagens por mime-types)

Installation
------------

[](#installation)

ToWebP is available via Composer:

```
"codeblog/conveter-php-webp": "^1.0"

```

or run

```
composer require codeblog/conveter-php-webp

```

Documentation
-------------

[](#documentation)

###### For details on how to use, see a sample folder in the component directory. In it you will have an example of use for each class. It works like this:

[](#for-details-on-how-to-use-see-a-sample-folder-in-the-component-directory-in-it-you-will-have-an-example-of-use-for-each-class-it-works-like-this)

Para mais detalhes sobre como usar, veja uma pasta de exemplo no diretório do componente. Nela terá um exemplo de uso para cada classe. Ele funciona assim:

#### Basic usage example

[](#basic-usage-example)

```
