Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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.

License

Notifications You must be signed in to change notification settings

celloopa/png-to-webp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

5 Commits

Repository files navigation

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:

    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:

    pip install -r requirements.txt
    
  6. Running the script After installing the dependencies, you can run the main.py script:

    python main.py
  7. Deactivating the Virtual Environment

    After you're done running the script, you can deactivate the virtual environment:

    deactivate

About

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /