Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
I

ipx

> DevOps
Open source

️ High performance, secure and easy-to-use image optimizer.

2.4K stars0 likes3 views
WebsiteGitHub

About

️ High performance, secure and easy-to-use image optimizer.

️ IPX

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.

Quick Start

Start a server for the images in the current directory with the ipx command:

bash
npx ipx serve --dir ./

Using bun:

bash
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.

Image URLs

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.

Modifiers

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.

/w_160/scene.jpg
Resize to a width in pixels, a positive integer. The height follows the aspect ratio. (docs)

/h_120/scene.jpg
Resize to a height in pixels, a positive integer. The width follows the aspect ratio. (docs)

/s_200x200/scene.jpg
Resize to {width}x{height}, both positive integers. A single value (s_200) is a square. (docs)

/s_80x80,kernel_nearest/photo.jpg
Sets kernel option for resize. One of nearest, linear, cubic, mitchell, lanczos2, lanczos3 (default), mks2013 or mks2021. (docs)

/s_300x150,fit_contain,b_00ff00/scene.jpg
Sets fit option for resize. One of contain, cover (default), fill, inside or outside. (docs)

/s_150x300,pos_top/scene.jpg
Sets position option for resize. A position (top, right top, ..., left top), gravity (north, northeast, ..., center) or strategy (entropy, attention), also accepted as their numeric constants. Since _ separates arguments, multi-word values use - (pos_right-top). (docs)

/extend_20_40_20_40_mirror/scene.jpg
Pad or extrude the edges, as extend_{top}{right}{bottom}_{left} with an optional {extendWith}. Edges are integers between 0 and 10000. extendWith is background (default), copy, repeat or mirror; background takes its colour from the background / b modifier. (docs)

/rotate_45,b_00ff00/scene.jpg
Background colour, a hex (f00, ff0000) or named (red) colour. Used by extend, rotate, flatten, opacity and resize (with fit_contain).

/extract_150_10_160_120/scene.jpg
Crop a region, as extract_{left}{top}{width}_{height}. All four arguments are required; width and height must be positive. (docs)

/f_webp/photo.jpg
Output format. One of jpg, jpeg, png, webp, avif, gif, heif, tiff or auto (experimental, only with middleware). (docs)

/q_10/photo.jpg
Encoding quality, an integer between 1 and 100. A lower value means a smaller file.

/rotate_45/scene.jpg
Angle in degrees, between -3600 and 3600. Angles that are not a multiple of 90 fill the corners with the background / b colour. Without an angle (rotate) the image is auto-oriented from its EXIF tag. (docs)

/enlarge,s_400x400/photo.jpg
Allow the image to be upscaled. Without it, the output is never larger than the source in any dimension, while preserving the requested aspect ratio.

/flip/scene.jpg
Mirror the image vertically, about the horizontal axis. Combine with flop to turn it upside down. (docs)

/flop/scene.jpg
Mirror the image horizontally, about the vertical axis. Combine with flip to turn it upside down. (docs)

/sharpen_5/photo.jpg
Sharpen the image, as {sigma}{flat}{jagged}{x1}{y2}_{y3}. sigma is a number between 0.000001 and 10, the rest between 0 and 1000000. Without arguments (sharpen) a mild sharpen is applied. (docs)

/median_10/photo.jpg
Apply a median filter, removing noise while keeping edges. Square mask size, an integer between 1 and 1000 (defaults to 3). (docs)

/blur_5/edges.jpg
Gaussian blur, as {sigma}{precision}{minAmplitude}. sigma is a number between 0.3 and 1000, precision one of integer (default), float or approximate, minAmplitude between 0.001 and 1. Without arguments (blur) a mild blur is applied. (docs)

/dilate_4/graphic.png
Expand foreground objects. Width in pixels, an integer between 1 and 100 (defaults to 1), capped below the sharp maximum since the cost grows with the width. (docs)

/erode_4/graphic.png
Shrink foreground objects. Width in pixels, an integer between 1 and 100 (defaults to 1), capped below the sharp maximum since the cost grows with the width. (docs)

/clahe_20_20_5/edges.jpg
Contrast limiting adaptive histogram equalization, as {width}{height}{maxSlope}. width is required and height defaults to it (a square window); both are integers between 1 and 100, clamped to the source dimensions. maxSlope is an integer between 0 and 100 (defaults to 3). (docs)

/flatten,b_00ff00,f_jpeg/alpha.png
Remove the alpha channel, if any, and replace transparency with the background / b colour. (docs)

/unflatten,f_webp/graphic.png
Make every fully white pixel transparent, so the output format needs an alpha channel (png, webp, avif). (docs)

/gamma_3/colour.jpg
Gamma correction, as {gamma}_{gammaOut}, each a number between 1.0 and 3.0 (defaults to 2.2). (<a href="https://sharp.p

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptcdndockerimagelibvips

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理