Graphrt

Image Tools

Metadata, resize, crop, rotate, convert (jpeg/png/webp/avif), compress, text or image watermarks and thumbnails, raster formats recognised by content, a decoded-pixel cap against decompression bombs, new output files only

Stable v0.1.0 Node.js 8 actions
Use in Graphrt Desktop

About

A Graphrt plugin for local images with sharp (libvips). Workflows and agents can read image metadata and resize, crop, rotate, convert, compress, watermark and thumbnail images that live in directories you allow. Every result is a new file in one output directory.

What it can do

  • metadata: format (detected from the content), displayed width/height after EXIF orientation, orientation, channels, colour space, alpha, density, pages, and whether EXIF/ICC/XMP data is present.
  • resize: target_width and/or target_height, fit (inside, cover, contain, fill, outside), no enlarging unless enlarge: true, padding background for contain.
  • crop: left, top, crop_width, crop_height on the displayed image, a box outside the image is refused.
  • rotate: any angle (corners filled with background), plus flip/flop.
  • convert: jpeg, png, webp, avif, gif or tiff with optional quality.
  • compress: re-encodes at quality (default 75), optionally capping the longest side, and reports the bytes saved.
  • watermark: a text line (text, font_size, color) or a second image (image, image_scale) at one of nine positions (placement) with margin and opacity.
  • thumbnails: up to 10 widths in one call (default webp, never enlarged).

Actions

Each action is a step you can add to a workflow. Agents can also use most of them as tools.

  • Read image metadata image-tools.metadata
  • Resize an image image-tools.resize
  • Crop an image image-tools.crop
  • Rotate or flip an image image-tools.rotate
  • Convert an image image-tools.convert
  • Compress an image image-tools.compress
  • Make thumbnails image-tools.thumbnails
  • Add a watermark image-tools.watermark

Settings

Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.

  • IMAGE_TOOLS_INPUT_DIRS (required)
    Comma-separated directories (absolute or ~/...) that images may be read from, subdirectories included
  • IMAGE_TOOLS_OUTPUT_DIR (none)
    Existing directory for outputs. Without it only metadata works. Outputs can be read back as inputs.
  • IMAGE_TOOLS_MAX_INPUT_BYTES 100 MiB
    Largest input file
  • IMAGE_TOOLS_MAX_OUTPUT_BYTES 100 MiB
    Largest output, nothing is written above it
  • IMAGE_TOOLS_MAX_INPUT_PIXELS 100000000
    Most decoded pixels (width × height) per image, against decompression bombs
  • IMAGE_TOOLS_TIMEOUT_SECONDS 60
    libvips timeout per pipeline (1 to 600)

How to use it

In Graphrt Desktop

  1. Open Plugins and search for Image Tools.
  2. Click Install and approve it.
  3. Follow the setup steps on the plugin's page, then paste the settings it needs.
  4. Describe a job that needs it, and the builder adds the steps.
Plugins in Graphrt Desktop

With the CLI

terminal
$ graphrt plugin install image-tools
workflow.yaml
- id: image_tools
  type: image-tools.metadata
Plugins in the docs