Convert image to webp in browser side
npm install webp-converter-browser---
Convert your image in browser side(frontend side).
``bashnpm
npm install webp-converter-browser
Usage
`ts
import { srcToWebP, blobToWebP, arrayBufferToWebP } from 'webp-converter-browser'// ...
// When it cause CORS, you may failed to use
srcToWebP
const webpBlob = await srcToWebP(pngSrc, { /* options / })
// or
const webpBlob = await blobToWebP(pngBlob, { /* options / })
// or
const webpBlob = await arrayBufferToWebP(jpgArrayBuffer, { /* options / })
`$3
`html
``| Name | Description | Default |
|-|-|--------------------|
| quality | image quality | 0.75 |
| width | image width | Given image width |
| height | image height | Given image height |