# image/format
Return the image's source format — the format its bytes were decoded from.
## Syntax
[image/format $img]
## Parameters
- `$img` — an `Image` value
## Examples
set img [image/open "test/fixtures/images/test.png"] [image/format $img] # → "png" set jpg [image/decode [unwrap [fs/read "photo.jpg"]]] [image/format $jpg] # → "jpeg"
## Returns
`"jpeg"`, `"png"`, or `"webp"`, or `nil` when the argument is not a live
`Image`. This reflects the decoded source format, not any output format set
afterwards by `image/jpeg` / `image/png` / `image/webp`.
## See Also
`image/dims`, `image/bytes`, `image/jpeg`, `image/png`, `image/webp`