# image/jpeg
Return a copy of the image with its output format set to JPEG. This tags the
image — encoding happens later in `image/bytes`, `image/write`, or
`image/base64`.
## Syntax
[image/jpeg $img ?opts]
## Parameters
- `$img` — an `Image` value
- `$opts` — optional map; `:quality` 1–100 (default 80). Out-of-range values
are clamped, not errors.
## Examples
set img [image/open "test/fixtures/images/test.png"] set out [image/jpeg $img %{ quality 90 }] [image/format [image/decode [image/bytes $out]]] # → "jpeg"
## Returns
A new `Image` with the same pixels and dimensions but JPEG 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`