https://github.com/designengineered/png-to-webp
This is a Python script that converts PNG images to WebP format in bulk. The user selects a directory, and the script converts all PNG images in that directory.
https://github.com/designengineered/png-to-webp
Last synced: 9 months ago
JSON representation
This is a Python script that converts PNG images to WebP format in bulk. The user selects a directory, and the script converts all PNG images in that directory.
- Host: GitHub
- URL: https://github.com/designengineered/png-to-webp
- Owner: designengineered
- License: mit
- Created: 2024-01-24T14:43:10.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-24T18:36:00.000Z (over 2 years ago)
- Last Synced: 2025-06-13T11:05:54.589Z (12 months ago)
- Language: Python
- Size: 8.24 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PNG to WebP Converter
This is a Python script that converts PNG images to WebP format in bulk. The user selects a directory, and the script converts all PNG images in that directory. The converted images are saved in a `converted` subdirectory within the selected directory. After the conversion process, the `converted` subdirectory is automatically opened in the default file explorer.
## Prerequisites
- Python 3.x
- Pillow library
## Installation
For all these code snippets use your terminal of choice. You can honestly copy and paste in the presented order and it should work.
1. Clone the repository:
```bash
git clone https://github.com/laztaxon/png-to-webp.git
```
2. Install Python:
- For Windows and macOS, download and install Python from the official website: https://www.python.org/downloads/
- For macOS, you can also use Homebrew: `brew install python` or
- For Linux, use your package manager, e.g., `sudo apt install python3`
3. Set up the virtual environment:
- For Windows, use: `python -m venv venv`
- For Unix or MacOS, use: `python3 -m venv venv`
4. Activate the virtual environment:
- For Windows, use: `venv\Scripts\activate`
- For Unix or MacOS, use: `source venv/bin/activate`
5. Install the required dependencies from the `requirements.txt` file:
```bash
pip install -r requirements.txt
6. Running the script
After installing the dependencies, you can run the main.py script:
```python
python main.py
7. Deactivating the Virtual Environment
After you're done running the script, you can deactivate the virtual environment:
```bash
deactivate