2018-11-08 12:34:21 +02:00
# Image formats support
2019-09-30 11:53:13 +02:00
At the moment, imgproxy supports only the most popular image formats:
2018-11-08 12:34:21 +02:00
2020-09-01 15:57:44 +02:00
| Format | Extension | Source | Result |
| -------|-----------|--------|--------|
| PNG | `png` | Yes | Yes |
| JPEG | `jpg` | Yes | Yes |
| WebP | `webp` | Yes | Yes |
2021-04-26 14:27:16 +02:00
| AVIF | `avif` | Yes | Yes |
2020-09-01 15:57:44 +02:00
| GIF | `gif` | Yes | Yes |
| ICO | `ico` | Yes | Yes |
| SVG | `svg` | Yes | [See notes ](#svg-support ) |
| HEIC | `heic` | Yes | No |
| BMP | `bmp` | Yes | Yes |
| TIFF | `tiff` | Yes | Yes |
2022-12-15 17:06:52 +02:00
| PDF ![pro ](./assets/pro.svg ) | `pdf` | Yes | No |
| MP4 (h264) ![pro ](./assets/pro.svg ) | `mp4` | [See notes ](#video-thumbnails ) | Yes |
| Other video formats ![pro ](./assets/pro.svg ) | | [See notes ](#video-thumbnails ) | No |
2018-11-08 12:34:21 +02:00
2019-10-11 15:33:34 +02:00
## SVG support
imgproxy supports SVG sources without limitations, but SVG results are not supported when the source image is not SVG.
2022-02-01 11:43:36 +02:00
When the source image is SVG and an SVG result is requested, imgproxy returns the source image without modifications.
2019-10-11 15:33:34 +02:00
2022-02-01 11:43:36 +02:00
imgproxy reads some amount of bytes to check if the source image is SVG. By default it reads a maximum of 32KB, but you can change this:
2020-02-11 15:28:13 +02:00
* `IMGPROXY_MAX_SVG_CHECK_BYTES` : the maximum number of bytes imgproxy will read to recognize SVG. If imgproxy can't recognize your SVG, try to increase this number. Default: `32768` (32KB)
2019-06-13 10:20:11 +02:00
## Animated images support
2018-12-02 15:02:19 +02:00
2022-02-01 11:43:36 +02:00
Since the processing of animated images is a pretty heavy process, only one frame is processed by default. You can increase the maximum of animation frames to process with the following variable:
2018-12-02 15:02:19 +02:00
2022-02-01 11:43:36 +02:00
* `IMGPROXY_MAX_ANIMATION_FRAMES` : the maximum of animated image frames to be processed. Default: `1` .
2019-06-13 10:20:11 +02:00
2023-02-23 20:23:16 +02:00
**📝 Note:** imgproxy summarizes all frames resolutions while the checking source image resolution.
2019-10-11 15:20:28 +02:00
2022-12-15 17:06:52 +02:00
## Converting animated images to MP4![pro](./assets/pro.svg) :id=converting-animated-images-to-mp4
2019-10-11 15:20:28 +02:00
2022-02-01 11:43:36 +02:00
Animated image results can be converted to MP4 by specifying the `mp4` extension.
2019-10-11 15:20:28 +02:00
2022-02-01 11:43:36 +02:00
Since MP4 requires use of a `<video>` tag instead of `<img>` , automatic conversion to MP4 is not provided.
2020-03-18 18:34:37 +02:00
2022-12-15 17:06:52 +02:00
## Video thumbnails![pro](./assets/pro.svg) :id=video-thumbnails
2020-03-18 18:34:37 +02:00
2022-02-01 11:43:36 +02:00
If you provide a video as a source, imgproxy takes a specific frame to create a thumbnail. To do this, imgproxy downloads only the amount of data required to reach the needed frame.
2020-03-18 18:34:37 +02:00
2022-02-01 11:43:36 +02:00
Since this still requires more data to be downloaded, video thumbnail generation is disabled by default and should be enabled with `IMGPROXY_ENABLE_VIDEO_THUMBNAILS` config option.
2020-03-18 18:34:37 +02:00
2022-02-01 11:43:36 +02:00
* `IMGPROXY_ENABLE_VIDEO_THUMBNAILS` : when true, enables video thumbnail generation. Default: `false`
* `IMGPROXY_VIDEO_THUMBNAIL_SECOND` : the timestamp of the frame (in seconds) that will be used for the thumbnail. Default: 1.