# image/webp
Return a copy of the image with its output format set to WebP. This tags the
image — encoding happens later in `image/bytes`, `image/write`, or
`image/base64`.
## Syntax
[image/webp $img ?opts]
## Parameters
- `$img` — an `Image` value
- `$opts` — optional map; `:quality` 0–100 (default 80). Out-of-range values
are clamped, not errors.
## Examples
set img [image/open "test/fixtures/images/test.jpg"] set out [image/webp $img %{ quality 70 }] [image/format [image/decode [image/bytes $out]]] # → "webp"
## Returns
A new `Image` with the same pixels and dimensions but WebP as its output
format and the given quality. `nil` when the argument is not a live `Image`.
## See Also
`image/encode`, `image/bytes`, `image/write`, `image/base64`