$worker

image-resize

v0.1.10

III engine image resize worker (JPEG/PNG/WebP, EXIF orient, scale-to-fit / crop-to-fit)

  • macOS: arm64 · x64
  • Linux: arm64 · armv7 · x64
  • Windows: arm64 · x64 · x86
agent-ready brief for v0.1.10
install + config + dependencies + readme + api reference, all in one place. fetch as agent-context.md for an llm to consume.
the same content rendered as discrete blocks below is exposed as a single markdown document at /workers/image-resize.md. paste it into an llm prompt or pipe it through curl from a worker.

install

install
$iii worker add image-resize@0.1.10

configuration

iii-config.yaml
- height: 200
  quality:
    jpeg: 85
    webp: 80
  strategy: scale-to-fit
  width: 200

dependencies

no dependencies for v0.1.10

readme

README.md

image-resize

A high-performance image resizing worker built for production workloads.

Installation

iii worker add image-resize

Configuration

Add the worker to your pipeline configuration:

- name: image-resize
  config:
    height: 200
    quality:
      jpeg: 85
      webp: 80
    strategy: scale-to-fit
    width: 200

Options

Option Type Default Description
width number 200 Target width in pixels
height number 200 Target height in pixels
strategy string scale-to-fit Resize strategy: scale-to-fit, crop, fill, contain
quality.jpeg number 85 JPEG output quality (1-100)
quality.webp number 80 WebP output quality (1-100)

Strategies

  • scale-to-fit — Resize to fit within the given dimensions, preserving aspect ratio
  • crop — Crop to exact dimensions from center
  • fill — Fill the area, stretching if necessary
  • contain — Contain within dimensions, adding padding if needed

Usage

import { pipeline } from '@iii/core';

const result = await pipeline.run('image-resize', {
  input: buffer,
  params: { width: 400, height: 300, strategy: 'crop' }
});

Performance

Benchmarks on a standard worker instance (2 vCPU, 512MB):

Format Avg Latency Throughput
JPEG 12ms ~83 ops/s
WebP 18ms ~55 ops/s
PNG 24ms ~41 ops/s

License

Apache 2.0 — see LICENSE.

api reference (json)

agent-api-reference.json
{
  "functions": [
    {
      "description": "Resize an image via channel I/O",
      "metadata": {},
      "name": "image_resize::resize",
      "request_schema": {},
      "response_schema": {}
    }
  ],
  "triggers": []
}