Overview
While most file types can be served through imgix, not all of them support imgix parameters.
For example, it's not possible to apply a w=300
parameter on a .js
file.
Supported file types
File types can interact with imgix either as input formats or output formats.
An input format is a file that will be accepted by imgix's parameters. You can transform images that are accepted with an input format by using imgix's API (w=600
, for example).
An output format is a file type that imgix can transform any input format into. For example, you can transform a jpg
into a png
using fm=png
.
Any non supported input format will be served without any transformations.
Filetype | Supported as input format | Supported as output format using FM |
---|---|---|
AI | X | |
APNG* | X | |
BMP | X | |
EPS* | ||
GIF | X | X |
HEIC |
X* |
|
ICO | X | |
ICNS | X | |
JPEG | X | X |
JPEG2000 | X | X |
JPEG XR | X | X |
JSON | X | |
PCT | X | |
X | ||
PJPEG | X | X |
PNG | X | X |
PNG8 | X | X |
PNG32 | X | X |
PSD | X | |
SVG |
X* |
|
TIFF | X | |
WEBM | X* | |
WEBP | X* | X |
MP4 | X |
*See file specific notes below
Serving other types of assets with imgix
Although imgix is optimized for serving images, it's possible to pass through other static assets such as JavaScript and CSS files from your Source. This will give you the benefit of serving other assets through our globally distributed CDN.
However, we do not guarantee the behavior of such assets—rendering parameters (especially default parameters) can affect the output and may accidentally output a rendering error.
When serving unsupported file types, it's important to not apply any parameters on the URL. While there's usually no issue with using parameters on unsupported input types, there are some rare instances where a parameter can cause unexpected behavior on certain file types.
If you have a Source configured with default parameter(s) that's causing issues with unsupported input assets, you can work around this issue by either:
- Serving those assets without using imgix or
- Use a separate Source in order to serve those assets
File specific notes
APNG
Animated PNGs will be rendered as a static APNG. For animations, please use animated GIFs (premium feature) instead.
EPS
Only supported as a pass through, not as an input type.
HEIC
HEIC will only work if the original image was created from an iOS device
SVG's
SVG's can be enabled as an input parameter by contacting support@imgix.com. If they are not yet enabled for your account, we can pass them through as long as they have a correct XML declaration at the top of the file.
Note that there is a security vulnerability for SVG's which allow for the execution of inline javascript when being served through a web browser.
By enabling SVG's as an input parameter, you can prevent execution of this code by allowing imgix to rasterize & serve the file. You can do this by applying any default parameter in your Source settings, such as auto=compress
.
Another way to prevent vulnerabilities related to SVG's is to prevent user uploaded SVG's, which prevent unauthorized SVG's from being served from your Source.
WEBP
Animated WebP is not yet supported as an input format.
WEBM
Transparency can be loss when converting a GIF into a WEBM. As an alternative, you can convert the GIF into an APNG to support transparency.