webp
WebP installation
Github:https://github.com/webmproject/WebPShop
Chinese tutorial: https://developers.google.com/speed/webp/docs/webpshop?hl=zh-cn
Recommended quick installation method:
https://formulae.brew.sh/formula/webp
Install directly with the command:
brew install webp
cwebp encoding (conversion to WebP)
cwebp
To convert images to WebP format, you can use the command line tool provided by Google . Here are cwebp
the steps to use the tool for image conversion:
-
Install WebP Tools: First, you need to install the WebP Toolkit. You can download precompiled binaries for your OS from the official WebP site ( https://developers.google.com/speed/webp/docs/precompiled ), or install using a package manager (e.g. on Ubuntu Install using
apt-get
the command). -
Open Terminal (Command Line Interface): Opens a terminal or command prompt so you can execute commands.
-
Run the conversion command: Use the following command to convert the image to WebP format:
cwebp [input_image] -o [output_image.webp]
where
[input_image]
is the path and filename of the input image file you want to convert and[output_image.webp]
is the path and filename of the output WebP file.For example, if you want to
input.png
convert a PNG image named WebP tooutput.webp
a WebP image, you can run the following command:cwebp input.png -o output.webp
This will generate
output.webp
a WebP image file named . -
Adjust conversion options (optional): There are
cwebp
other options you can use to adjust the parameters of the conversion process. For example, you can specify compression quality, resize images, and more. For more options, run the following command to view the help documentation:cwebp --help
This will display
cwebp
the help information for the command with the various options available and their descriptions. -
Result
Nothing is set, the compression is very small
dwebp decode
To decode, use the dwebp command.
Specify size:
More parameter configuration
https://www.jianshu.com/p/61ab330a6de6
Android Studio Encoding WebP
1、Convert to WebP…
2. Options
-
Quality changed from lossy 0 (image downgraded to fit in less bytes) to lossless 100 (pixels remain the same). Compressed size usually increases with quality, but for some images (such as screenshots, solid colors, etc.), the lossless algorithm produces smaller files.
-
The compression operation controls the encoding speed. Slowing it down increases visual quality and/or reduces file size.
-
The preview function will show the compressed picture and its final size. If the photo is too tall or too wide, a movable zoom-in area will appear. WARNING: For large images and/or heavy compression jobs, the GUI may become slow/unresponsive with this feature enabled.
-
For animations (multiple layers with a duration in the name, such as "Frame1 (123 ms)"), the slider selects the current frame and shows its preview and duration.
3. Compression
After compression, some pictures cannot be compressed, just like this prompt:
0 files were converted 3 files were skipped because there was no net space saving
0 files were converted, 3 files were skipped because there was no net space saved