![]() ![]() The resultant 'lossy' file means that quality can never be recovered. Also, we learned how to convert WebP to PNG and JPEG.JPG's are often used for web sites and email as they are generally smaller file sizes as they are lossy meaning that some image quality is lost when the JPG is compressed and saved. This article covered how to convert PNG, JPEG format to WebP in Ubuntu. In this way, we can convert png and jpeg format images to webp format and vice versa. It can be seen that the size of the image has been comparatively increased after decoding the webp image format. $ dwep image.webp -o image.png $ dwep image.webp -o image.jpeg In the example, image.webp is used for the conversion. Use the dwep command with the option -o to create png and jpeg image format from webp. Now we will use the dwebp tool to convert webp images into png and jpeg format. In the previous step, we converted jpeg and png images to webp using cwebp utility tool. $ vwebp linux.webap Converting webp image to png and jpeg format In this example, I have used a previously converted linux.webp file. Run the following command to open the webp format images. In the output, you can see that the size of the image has been comparatively decreased. $ cwebp -q 60 linux.png -o linux.webp $ cwebp -q 60 linux.jpeg -o linux1.webp You can choose your image name accordingly. In this example, I have used image file linux.png and l inux.jpeg file to convert in webp format. Run the cwebp command with option -q to define the quality of image and -o to define the output file. Using the cwebp tool, an image can be converted into webp format. Open a new terminal and use webp utility tools like other system commands. $ sudo vi ~/.bashrcĬopy the following line at the end of the file. bashrc file to run the webp utility tools without writing the absolute path. Now add the directory ~/ libwebp-0.6.1-linux-x86-32/bin to the PATH environment variable in the ~/. To find all the options provided by the webp utility tool, use the following command. Webpinfo : This tool is usable to view information about a webp image file Vwebp : This tool is used to view webp files In the directory, you can see the precompiled binary files which are usable for various webp utilities such as:Īnim_diff : This tool can be used to find the difference between animation imagesĪnim_dump: This tool is usable to dump the difference between animation imagesĬwebp : This tool can be used for webp encodingĭwebp : This tool is used for webapp decoding $ sudo apt-get update $ sudo apt install webpĪlso, you can install the webp package from Google’s repository as: $ wget Įxtract the tar file and move to the extracted directory. Run the command below to update the Ubuntu repository to the latest index and install webp package. The webp package is already available in the official ubuntu repositories. This article will cover how to use webp image format for creating compressed and quality images for the website. One of the best practices to optimize the website performance is using compressed images. Webp is an open-source image format in Linux which supports lossless and lossy compression for images on the web. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |