mirror of
https://github.com/tiennm99/webp-converter.git
synced 2026-06-08 10:13:43 +00:00
main
webp-converter
Lightweight HTTP microservice written in Go that converts WebP images to PNG on-the-fly — accepts an image URL, returns the converted PNG bytes.
Quick start
go build -o webp-converter .
./webp-converter
# Server listens on :8080
Docker:
docker build -t webp-converter .
docker run --rm -p 8080:8080 webp-converter
Usage
POST a JSON body with the source image URL to /process:
curl -X POST http://localhost:8080/process \
-H "Content-Type: application/json" \
-d '{"img": "https://example.com/image.webp"}' \
--output image.png
- If the URL points to a WebP image, the response is the converted PNG.
- If the URL points to any other format, the original image bytes are returned unchanged (pass-through).
Output formats
| Input | Output |
|---|---|
| WebP | PNG |
| Any other format | Original (pass-through) |
Related
- image-resizer — batch-resize images by percentage (same domain, different operation).
License
Apache-2.0 — see LICENSE.
Description
Languages
Go
64.2%
Dockerfile
35.8%