Skip to content
Registry

image-resize

v0.1.18

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

license: Apache-2.0imagejpegmediapngresizewebp

Install

bash
iii trigger compose::add worker=image-resize@0.1.18

Run in your project with the iii engine running. Exact versions are immutable and digest-pinned.

Agent-ready brief for v0.1.18
Install, config, dependencies, readme, skills and 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?version=0.1.18. Paste it into an LLM prompt or pipe it through curl from a worker.

Install

iii trigger compose::add worker=image-resize@0.1.18

Configuration

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

Dependencies

No dependencies for v0.1.18

Readme

README.md

image-resize

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

Installation

iii trigger compose::add worker=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 to a target width and height (thumbnail) over channel I/O.",
      "metadata": {},
      "name": "image_resize::resize",
      "request_schema": {
        "properties": {
          "input_channel": {
            "description": "StreamChannelRef (read) carrying metadata text + image binary",
            "type": "object"
          },
          "metadata": {
            "description": "Optional inline ImageMetadata override",
            "properties": {
              "format": {
                "description": "Source image format",
                "enum": [
                  "jpeg",
                  "png",
                  "webp"
                ],
                "type": "string"
              },
              "height": {
                "type": "integer"
              },
              "output_format": {
                "description": "Desired output format (defaults to source format)",
                "enum": [
                  "jpeg",
                  "png",
                  "webp"
                ],
                "type": "string"
              },
              "quality": {
                "type": "integer"
              },
              "strategy": {
                "enum": [
                  "scale-to-fit",
                  "crop-to-fit"
                ],
                "type": "string"
              },
              "target_height": {
                "type": "integer"
              },
              "target_width": {
                "type": "integer"
              },
              "width": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "output_channel": {
            "description": "StreamChannelRef (write) for thumbnail output",
            "type": "object"
          }
        },
        "required": [
          "input_channel",
          "output_channel"
        ],
        "type": "object"
      },
      "response_schema": {
        "properties": {
          "format": {
            "type": "string"
          },
          "height": {
            "type": "integer"
          },
          "strategy": {
            "type": "string"
          },
          "width": {
            "type": "integer"
          }
        },
        "type": "object"
      }
    }
  ],
  "triggers": []
}

Search the registry

Find workers, kits and executables, or jump to a page.