A self hostable Flask web application that allows users to upload a WEBP file and get a PNG file in return. The application uses Pillow (PIL fork) to handle the image conversion.
- Upload WEBP files
- Convert WEBP files to PNG format
- Download the converted PNG files
- Python 3.9 or higher
- Flask
- Pillow
- Docker (for containerization)
-
Clone the repository:
git clone https://github.com/tshenolo/flask-webp-to-png.git cd flask-webp-to-png
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Set the FLASK_APP environment variable:
On Linuxexport FLASK_APP=app.py
On Windows
set FLASK_APP=app.py
-
Run the Flask development server:
flask run
-
Open a web browser and go to http://127.0.0.1:5000/.
- Build the Docker image:
docker build -t flask-webp-to-png .
-
Run a container from the image:
docker run -d -p 5000:5000 flask-webp-to-png
-
Open a web browser and go to http://127.0.0.1:5000/.
/flask-webp-to-png
├── app.py
├── templates
│ └── upload.html
├── requirements.txt
└── Dockerfile
- Fork the repository.
- Create a new branch (git checkout -b feature-branch).
- Commit your changes (git commit -am 'Add new feature').
- Push to the branch (git push origin feature-branch).
- Create a new Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.