mcpField
I
image-resize

image-resize

github.com/agntswrmCreative & media684 installsUpdated 34w ago
Repository

About image-resize

image-resize is a command-line skill for resizing images from a file path or URL. It accepts a target width or height, can preserve aspect ratio, and uses the local sharp provider without an API key by default.

Key features

  1. 01Resize from a file path or URL
  2. 02Set target width or height
  3. 03Optionally preserve aspect ratio
  4. 04Choose an output path
  5. 05Use the local sharp provider

Use cases

  1. 01Resize a photo to a target width
  2. 02Set an image to exact dimensions
  3. 03Save a resized image to a chosen location

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/agntswrm/agent-media --skill image-resize

After installing, type/image-resizein Claude Code to confirm it loaded.

Details

From the project README

Image Resize

Resizes an image to a target width or height while optionally maintaining aspect ratio.

Command

npx agent-media@latest image resize --in <path> [options]

Inputs

OptionRequiredDescription
--inYesInput file path or URL
--widthNoTarget width in pixels
--heightNoTarget height in pixels
--outNoOutput path, filename or directory (default: ./)
--providerNoProvider to use (default: auto-detect)

At least one of --width or --height must be specified.

Output

Returns a JSON object with the resized image path:

{
  "ok": true,
  "media_type": "image",
  "action": "resize",
  "provider": "local",
  "output_path": "resized_123_abc.png",
  "mime": "image/png",
  "bytes": 45678
}

Examples

Resize to 800px width:

npx agent-media@latest image resize --in photo.jpg --width 800

Resize to exact dimensions:

npx agent-media@latest image resize --in photo.jpg --width 1024 --height 768

Resize with custom output:

npx agent-media@latest image resize --in image.png --width 500 --out ./resized

Providers

  • local (default) - Uses sharp library, no API key required

Comments

Markdown supported