provides a API to convert image(JPG, PNG) -> WEBP
WebP is a modern image format that provides superior lossless and lossy compression for images on the web. Using WebP, webmasters and web developers can create smaller, richer images that make the web faster.
The purpose of this repository is a project to convert image files to the next generation image format (webp).
- git clone
git clone [email protected]:shoridevel/image-to-webp.git
- docker build
docker build ./ -t image-to-webp
- docker run
docker run -d -p 3001:3001 --name image-to-webp image-to-webp
- Check with cURL
curl -v "http://localhost:3001" -X POST -F [email protected] -o image.webp
export PATH="$PATH:/<Set your path>/libwebp-1.2.1-mac-10.15/bin"
- node package install
yarn install
- run
For development
yarn dev
For Production
yarn start
http://localhost:3001/api-docs
option params
q=50(quality 1~100, Optional pamameter)
You can reduce the size of the image file by specifying the image quality.
curl "localhost:3001/" -X POST -F [email protected] -F q=75 -o image.webp
or just simply call:
curl "localhost:3001/" -X POST -F [email protected] -o image.webp