image

v0.2.0
com.yaktool/image Checked 4 days ago Published 3 months ago

Compress, 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…

ParameterTypeDescription
path *stringAbsolute path to the PNG or JPEG file to compress.
formatstringOutput format, default "same" (no conversion). webp/avif honour mode: lossy at the mapped quality, or true lossless.
modestringsmart (default) = visually-guarded lossy; lossless = pixels byte-identical, metadata and encoding only.
outstringAbsolute output path. Default: alongside the input as <name>-compressed.<ext> (extension follows `format`). Never overwrites an existing file.
qualityinteger0-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…

ParameterTypeDescription
path *stringAbsolute path to the PNG, JPEG, WebP or AVIF file to convert.
allowUpscalebooleanDefault false: refuse to scale up, keep the original size and report ICV-002 instead.
fitstringHow to reach an exact width×height: fit (never crop, default), crop (centre-crop), pad (white borders).
heightintegerTarget height in px.
outstringAbsolute output path. Default: alongside the input as <name>-converted.<ext>. Never overwrites an existing file.
presetstringMarketplace preset: sets target format and size, and enables the platform recheck.
targetstringOutput format. Defaults to the preset's format, or jpeg when no preset is given.
widthintegerTarget width in px. Overrides the preset size when given.