️ High performance, secure and easy-to-use image optimizer.
️ High performance, secure and easy-to-use image optimizer.
High performance, secure and easy-to-use image optimizer powered by sharp and svgo.
Point IPX at a directory or a list of allowed domains, and every image is available in any size, format and quality straight from its URL:
/w_512,f_webp/photos/buffalo.png[!NOTE] This is the active development branch for IPX v4. Check out v3 for v3 docs, and release notes (alpha, beta) if you are upgrading.
Start a server for the images in the current directory with the ipx command:
npx ipx serve --dir ./Using bun:
bunx ipx serve --dir ./Then open the printed URL and add modifiers to any image path, for example http://localhost:3000/w_200/buffalo.png.
To embed IPX in your own app instead, see the Programmatic API.
A request URL is a list of modifiers, followed by the id of the source image:
/<modifiers>/<id>Multiple modifiers are separated by , and their arguments by _. Use _ alone when no modifier is needed.
| URL | Result |
|---|---|
/_/static/buffalo.png |
The original image. |
/w_200/static/buffalo.png |
Width set to 200, original format (png) kept. |
/f_webp/static/buffalo.png |
Format changed to webp, everything else kept as in the source. |
/f_auto/static/buffalo.png |
Best format for the client (avif/webp/jpeg), negotiated from the browser's accept header. |
/s_200x200,fit_contain,f_webp/static/buffalo.png |
Resized to fit inside 200x200px on a background canvas and converted to webp. |
The URL style is configurable, see Custom URL Style.
Modifier arguments are separated with _ and validated before they reach sharp. Invalid input is rejected with a 400 IPX_INVALID_MODIFIER_ARG (or 400 IPX_MISSING_MODIFIER_ARG for a required argument) instead of failing the request. Some arguments can only be validated by libvips once it runs, which happens after the whole pipeline is set up; those surface as a 400 IPX_INVALID_MODIFIER. Trailing arguments may be omitted to keep the sharp default, except where noted.
Colours (background, tint) accept any colour sharp understands: hex (f00, ff0000, ff000080) with an optional leading # — which cannot be used inside a URL path, so it may be dropped — or a CSS colour name (red). Boolean arguments accept true / false as well as the shorter 1 / 0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
No open issues yet, or sync has not completed.