1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-01-08 10:45:04 +02:00
imgproxy/docs/image_formats_support.md

75 lines
3.7 KiB
Markdown
Raw Normal View History

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 |
| 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 |
2021-10-01 12:26:12 +02:00
| PDF<i class='badge badge-pro'></i> | `pdf` | Yes | No |
| MP4 (h264)<i class='badge badge-pro'></i> | `mp4` | [See notes](#video-thumbnails) | Yes |
| Other video formats<i class='badge badge-pro'></i> | | [See notes](#video-thumbnails) | No |
2018-11-08 12:34:21 +02:00
## GIF support
imgproxy supports GIF output only when using libvips 8.7.0+ compiled with ImageMagick support. Official imgproxy Docker image supports GIF out of the box.
2018-11-15 16:04:12 +02:00
2019-06-13 10:20:11 +02:00
## ICO support
2018-11-15 16:04:12 +02:00
2019-09-30 12:03:07 +02:00
imgproxy supports ICO only when using libvips 8.7.0+ compiled with ImageMagick support. Official imgproxy Docker image supports ICO out of the box.
2018-11-15 16:04:12 +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.
When the source image is SVG and the SVG result is requested, imgproxy returns source image without modifications.
2020-02-11 15:28:13 +02:00
imgproxy reads some amount of bytes to check if the source image is SVG. By default it reads maximum of 32KB, but you can change this:
* `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-25 11:28:34 +02:00
## HEIC support
imgproxy supports HEIC only when using libvips 8.8.0+. Official imgproxy Docker image supports HEIC out of the box.
## AVIF support
imgproxy supports AVIF only when using libvips 8.9.0+ with compiled support for libheif + its supported encoder (rav1e, aom). Official imgproxy Docker image supports AVIF out of the box.
## BMP support
2019-09-30 13:36:38 +02:00
imgproxy supports BMP only when using libvips 8.7.0+ compiled with ImageMagick support. Official imgproxy Docker image supports ICO out of the box.
By default, imgproxy saves BMP images as JPEG. You need to explicitly specify the `format` option to get BMP output.
2019-06-13 10:20:11 +02:00
## Animated images support
2018-12-02 15:02:19 +02:00
2019-06-13 10:20:11 +02:00
Since processing of animated images is pretty heavy, 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
2019-06-13 10:20:11 +02:00
* `IMGPROXY_MAX_ANIMATION_FRAMES`: the maximum of animated image frames to being processed. Default: `1`.
**📝Note:** imgproxy summarizes all frames resolutions while checking source image resolution.
2019-10-11 15:20:28 +02:00
2021-10-01 12:26:12 +02:00
## Converting animated images to MP4<i class='badge badge-pro'></i> :id=converting-animated-images-to-mp4
2019-10-11 15:20:28 +02:00
Animated images results can be converted to MP4 by specifying `mp4` extension.
Since MP4 requires usage of a `<video>` tag instead of `<img>`, automatic conversion to MP4 is not provided.
2021-10-01 12:26:12 +02:00
## Video thumbnails<i class='badge badge-pro'></i> :id=video-thumbnails
If you provide a video as a source, imgproxy takes its specific frame to create a thumbnail. Doing this imgproxy downloads only the amount of data required to reach the needed frame.
Since this still requires more data to be downloaded, video thumbnails generation is disabled by default and should be enabled with `IMGPROXY_ENABLE_VIDEO_THUMBNAILS` config option.
2020-04-17 18:12:15 +02:00
* `IMGPROXY_ENABLE_VIDEO_THUMBNAILS`: when true, enables video thumbnails generation. Default: false;
* `IMGPROXY_VIDEO_THUMBNAIL_SECOND`: the timestamp of the frame in seconds that will be used for a thumbnail. Default: 1.