This repository contains two Python scripts for converting images to WebP format. One script is for command-line usage, and the other provides a graphical user interface (GUI) for easier interaction.
image_to_webp.py: A command-line tool for converting images to WebP format.image_to_webp_gui.py: A GUI tool for converting images to WebP format.
- Python 3.x
- Pillow library
- Tkinter library (for the GUI tool)
You can install the required libraries using pip:
pip install PillowTkinter is included with standard Python installations. If you encounter issues, you may need to install it separately.
The image_to_webp.py script allows you to convert images to WebP format using the command line.
files: Paths to the image files to convert.save_directory: Directory to save the converted WebP images.quality: Quality of the output WebP images (1-100).
python image_to_webp.py image1.jpg image2.png /path/to/save/directory 80The image_to_webp_gui.py script provides a graphical user interface for converting images to WebP format.
-
Run the script:
python image_to_webp_gui.py
-
A file dialog will appear to select multiple image files.
-
Another dialog will appear to select the directory to save the converted WebP images.
-
A dialog will prompt you to enter the quality of the output WebP images (1-100).
-
The images will be converted and saved to the specified directory.