![]()
It is always difficult to convert all the JPEG and PNG images into a directory manually. Webp converter command line how to#Now, Let’s see how to do that in bulk! Convert all the JPEG and PNG Images in a Directory So, this is how you can convert a single jpg or png file to webp format. $ sudo cwebp -lossless tree.png -o tree.webp To convert the PNG file for testing, execute the following command. We mainly use this option to convert the PNG file to maintain its quality. To retain the complete data of the image during the compression, use the ‘-lossless’ option in the place of -q. rw-r-r- 1 sshusr sshusr 3.9M Jan 23 16:46 chinawall.webp rw-r-r- 1 sshusr sshusr 7.4M Jan 18 23:36 chinawall.jpg $ sudo ls -lh chinawall.jpg chinawall.webp Once converted, you can check the drastic size decrease of the file using the ls command. The -q in the above given command specifies the image quality that needs to get retained after the conversion. Since we are already in the ‘/var/-o chinawall.webp The -o option species the path where you want to save the converted WebP file. The general syntax of the cwebp command to convert the image format is: $ cwebp image.jpg -o image.webp We can convert the PNG and JPEG images to the “.webp” format using the command-line utility of WebP. $ sudo cd /var/www/html/webp Compress Image Files into WebP Format With cwebp Then, switch to the ‘/var/www/html/webp’ directory. $ sudo wget -c "" -O /var/www/html/webp/tree.png $ sudo wget -c "" -O /var/www/html/webp/chinawall.jpg Execute the following commands to download the test images using wget. Webp converter command line install#The wget utility is in-built in the Ubuntu operating system so you don’t have to install it. To test the cwebp command-line utility, we can download free PNG and JPEG images using wget. Then, change the ownership of the above-created directory to the ssh user ‘sshusr’. $ sudo apt install webpĪfter that, create a new image directory named ‘webp’ in the Apache root directory. $ sudo apt updateĮxecute the following command to install WebP on your server. Webp converter command line update#Now, update the repositories by executing the following command. Log in to the server as an ssh user with sudo privileges. To install the cwebp command-line utility on your Ubuntu server, follow these steps: The cwebp is a command-line utility that helps compress images into the ‘.webp’ format. And then we will create a directory with images for testing. Webp converter command line software#Steps to Install cwebp and Prepare the Image Directoryįirst, we need to install the software that helps us convert the images. To know more about how to install a LAMP stack on Ubuntu, refer to.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |