Resize, crop and convert from the URL
Each URL names an operation, its size and a list of options. The picture is rendered on the first request and served from cache after that.
Four operations
The operation comes first in the path and decides how the picture is sized.
| Operation | In the URL | What it does |
|---|---|---|
| cover | /cover/600x400/ | Resize and crop to the exact size. |
| width | /width/800/ | Resize to a width. The height follows the aspect ratio. |
| height | /height/600/ | Resize to a height. The width follows the aspect ratio. |
| cdn | /cdn/ | No resize. Rotate from EXIF, compress and serve. |
Pick what to keep
Add a mode after cover to choose the crop. Without one, cover uses smart.
https://img.imagefoundry.io/acme/cover:attention/600x400/products/shoe.jpg
Crop modes
Smart crop and face crop are on the Pro and Scale plans.
smart, attention
Keeps the most striking region, judged by luminance and saturation.
entropy
Keeps the region with the most detail.
face
Keeps the detected faces in frame. Falls back to attention when there are none.
contain, inside
Fit inside the box. contain pads to the full size with fill-color, inside does not pad.
north … center
The compass points: north, northeast, east, southeast, south, southwest, west, northwest and center.
fp-x, fp-y, fp-z
A focal point from 0 to 1 on each axis, with an optional zoom from 1 to 100.
The right format for each browser
format:auto reads the Accept header and sends AVIF, then WebP, then the original format. Responses carry Vary: Accept so the CDN keeps one copy per format.
https://img.imagefoundry.io/acme/width/800/format:auto,quality:70/products/shoe.jpg
Format and quality
| Option | Values | Notes |
|---|---|---|
| format | auto, jpg, png, webp, avif, tiff, gif | Output format. Without it, the original format is kept. |
| quality | 1–100 | Defaults to 80. |
| lossless | true | Lossless WebP and AVIF. |
| progressive | true, false | Progressive JPEG and PNG. On by default. |
| chromasub | 420, 422, 444 | JPEG chroma subsampling. 444 is the sharpest. |
| colorquant | 2–256 | Reduce a PNG to this many colours. |
| dpr | 1–8 | Multiply the output size for high-density screens. |
Watermarks and text
Place a logo from the same source, or set text in one of the bundled fonts. Both can be positioned, scaled and faded.
# Logo in the bottom-right corner at 80% opacity
https://img.imagefoundry.io/acme/width/800/
wmk-path:%2Flogo.png,wmk-position:southeast,wmk-pad:15,wmk-opacity:80/
products/shoe.jpg
# Text along the bottom with a soft shadow
https://img.imagefoundry.io/acme/width/800/
txt:Free%20shipping,txt-size:48,txt-color:ffffff,txt-position:south,txt-shad:2/
products/shoe.jpgOverlay options
wmk-*
wmk-path, wmk-position, wmk-scale (1–100), wmk-opacity (1–100), wmk-rotate (0–359), wmk-tile, and a minimum base size with wmk-min-w and wmk-min-h.
txt-*
txt, txt-font, txt-size, txt-color, txt-position, txt-pad, txt-shad (0–10), txt-width, txt-lead, txt-track and txt-clip.
blend-img
Blend a second picture over the first with blend-mode and blend-alpha (0–100).
More options
| Task | Options |
|---|---|
| Cut a region out first | extract-top, extract-left, extract-width, extract-height |
| Pad the picture | pad, pad-top, pad-right, pad-bottom, pad-left, fill-color |
| Round corners or mask | corner-radius, mask:ellipse, mask-bg |
| Rotate and flip | rotate (0–359), flip (h, v, hv), autorotate:false |
| Trim plain edges | trim, trim-tol (0–100), trim-color, trim-pad |
| Never upscale | withoutEnlargement:true |
| Render one PDF page | page:3 |
| Flatten an animation | animation:false |
| Keep EXIF data | keep-metadata:true |
Related
Try it on one picture.
Free for 1,000 transformations a month. No card needed to start.