What is libwebp?
Libwebp is an open source software library developed by Google to encode and decode images in the WebP format.
WebP, also created by Google, is an image format that offers high quality with smaller file sizes than traditional formats such as JPEG and PNG.
This means that WebP images load faster, which can improve performance and user experience on websites and applications.
libwebp provides an easy way to integrate WebP functionality into your own programs.
Some of libwebp’s features include:
- WebP image encoding and decoding.
- Support for lossy and lossless images.
- Support for transparency.
- Precise control over image quality.
- Easy-to-use APIs.
Posts relacionados:
- Como criar uma chave SSH
- Como restaurar chaves SSH
- Como fazer o backup de chaves SSH
- Como instalar a linguagem de programação Swift no Linux
- Como instalar a linguagem de programação Swift no macOS
- Gnome Builder o IDE para desenvolvimento de aplicativos GTK
- Como instalar o editor de texto Zed no Linux
- Como instalar a ferramenta de linha de comando pipX
- Variáveis, Constantes e Literais na linguagem Swift
- As melhores distribuições Linux com o ambiente desktop Xfce
Installation
Linux
Arch Linux
sudo pacman -S \
libwebp
Fedora
sudo dnf install \
libwebp
Ubuntu
sudo apt install \
libwebp
macOS
Homebrew
brew install \
webp
Pre-compiled utilities
Google provides pre-compiled utilities for the following operating systems:
- Microsoft Windows (x64).
- Linux (aarch64).
- Linux (x86-64).
- macOS (arm64).
- macOS (x86-64).
To download the utility go to:
After downloading, unzip the downloaded file into a directory where it will not be removed.
Then add the bin folder to the operating system’s PATH.
Linux
Edit the .bashrc
file and add the path to the bin folder:
export PATH="path/folder-name/bin:$PATH"
Some Linux distributions already have the $HOME/.local/bin
and $HOME/bin
folders mapped in the PATH
variable.
In this case, simply copy the binaries from the bin folder to one of the operating system’s bin folders.
If you need to map these directories in the operating system’s PATH variable, you can use the following commands:
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
Or
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
After adding it, you need to run it:
source ~/.bashrc
macOS
Add the path to the bin folder in the .bash_profile
file:
export PATH="$PATH:path/folder-name/bin"
Or add a file with the path to the paths.d
directory:
sudo -s 'echo "path/folder-name/bin" > /etc/paths.d/libwebp'
Microsoft Windows
Open the Environment Variables application.
Select the Path variable and click the Edit… button:
Selecione a variável Path
e clique no botão Editar...
:
![Aplicativo Variáveis de Ambiente.](https://justcode.com.br/wp-content/uploads/2024/03/image-1.webp)
Click on new and add the path to the bin
folder:
![Aplicativo Editar a Variável de Ambiente.](https://justcode.com.br/wp-content/uploads/2024/03/image-2.webp)