This is a Python script that converts .webp files to almost any picture format. You can run the script in a Jupyter notebook and modify the input directory and output format to suit your needs.
Before using this script, you will need:
-
Python installed on your computer.
-
Required Python Libraries
- Pillow - a Python Imaging Library (PIL) fork.
- os - a module that provides a portable way of using operating system dependent functionality.
To get started:
- Open VSCode.
- Open the folder where the files are (Ctrl+k followed by Ctrl+o)
- Create a new file and select Jupyter notebook when prompted.
- Copy and paste the code from this repository into the new Jupyter notebook file and run it.
To run the script, you will need to install the following libraries:
- Pillow - a Python Imaging Library (PIL) fork.
- os - a module that provides a portable way of using operating system dependent functionality.
To install these libraries, you can use the pip package manager inside the jupyter notebook.
- To install Pillow use: pip install Pillow
- To install os use: pip install os
To use the script, you will need to modify the input directory and the output format to match your needs. Here's how you can do it:
- In the code, replace /path/to/webp/files with the path to the directory that contains the .webp files you want to convert.
- In the code, replace /path/to/jpg/files with the path to the directory where you want to save the converted files.
- You can also replace .jpg with the file extension of your choice.
- Run the script by pressing the "Run" button in the Jupyter notebook.
- The script will convert all of the .webp files in the input directory to the specified output format and save them in the output directory.
- The original .webp files will be moved to a new folder named "old".
If you encounter issues with the script:
- Ensure that the python kernel is being read by your IDE.
- Check that the input and output directories are correct.
- Verify that you have the necessary permissions to read from and write to the directories.
- Ensure that the file extension you specified is valid for the output format you want to use.
If you need further assistance, please feel free to open an issue in this repository.