image.convert
Re-encode an image to another format at a chosen quality. It's the terminal encoder of a branch — the last thing that runs before the bytes are written out.
Config
| Field | Type | Default | Notes |
|---|---|---|---|
format | jpg · png · webp · avif · gif · tiff | jpg | Output container. The inputs it can read are on Compatible files. |
quality | number 1–100 | 90 | The only dial. Applies to jpg, webp, avif, tiff; ignored by png and gif. Out-of-range values are clamped. Per-codec effort is the transport’s choice, not yours to set. |
Leave
image.convert off a branch and the image passes through in its source format (resize still applies) — the cheapest path when you only need to shrink dimensions.Choosing a format
webp— the default reach-for: broad support, small atquality75–85.avif— smallest for the same quality, slower to encode. Great for hero images.jpg— universal, photographic.png— lossless, transparency. Reach forwebp/avifunless you need lossless.
In a pipeline
{
id: 'convert',
type: 'image.convert',
config: {
format: { value: 'webp' },
quality: { value: 82 },
},
}With runQueue
tk.runQueue(files, 'image')
.maxSize(2048)
.convert({ format: 'avif', quality: 60 });Convert pairs with image.resize in a single decode/encode pass, so a resize-then-convert branch never touches the pixels twice.