image
v0.2.0Compress, convert and resize images locally, with marketplace presets and rule rechecks.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
compress_image Compress a PNG/JPEG image file (local, lossless or smart-lossy)
Compress a local PNG or JPEG file with the same engine as the yaktool web compressor, documented in 12 published behaviours. smart mode (default): PNGs are palette-quantized with an alpha-weighted PSNR floor derived from `quality` (fewest colours that stay above the floor; falls back to lossless when even 256 colours would visibly degrade); JPEGs are re-encoded with mozjpeg, progressive. lossless mode: pixels stay byte-identical — PNGs lose only render-neutral metadata chunks and get an oxipng pass; JPEGs are rebuilt without metadata segments. Optional `format` converts to WebP or AVIF (both…
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path to the PNG or JPEG file to compress. |
format | string | Output format, default "same" (no conversion). webp/avif honour mode: lossy at the mapped quality, or true lossless. |
mode | string | smart (default) = visually-guarded lossy; lossless = pixels byte-identical, metadata and encoding only. |
out | string | Absolute output path. Default: alongside the input as <name>-compressed.<ext> (extension follows `format`). Never overwrites an existing file. |
quality | integer | 0-100, default 60. In smart mode this sets the PNG PSNR floor (30 + q*0.1 dB) and the mozjpeg/WebP/AVIF encoder quality. Ignored in lossless mode. |
convert_image Convert/resize an image file to a format or marketplace preset (local)
Convert a local image between PNG, JPEG, WebP and AVIF, optionally resizing it, with the same engine as the yaktool web converter (5 documented behaviours). MARKETPLACE PRESETS: pass preset (amazon-main | gmc | ebay) to get that platform's target format and size, and the output is RECHECKED against the platform's published rules — the result carries a per-rule verdict list (recheck.verdicts, rule IDs MED-*/IMG-S01) and recheck.allPass, so you can tell the user whether the file is actually right for the platform, not just converted. RESIZING: fit (default) scales inside the box and never crop…
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path to the PNG, JPEG, WebP or AVIF file to convert. |
allowUpscale | boolean | Default false: refuse to scale up, keep the original size and report ICV-002 instead. |
fit | string | How to reach an exact width×height: fit (never crop, default), crop (centre-crop), pad (white borders). |
height | integer | Target height in px. |
out | string | Absolute output path. Default: alongside the input as <name>-converted.<ext>. Never overwrites an existing file. |
preset | string | Marketplace preset: sets target format and size, and enables the platform recheck. |
target | string | Output format. Defaults to the preset's format, or jpeg when no preset is given. |
width | integer | Target width in px. Overrides the preset size when given. |