Loading...
Loading...
Crops an image to specified dimensions around a focal point. Use when you need to extract a portion of an image, create thumbnails with custom positioning, or prepare images for specific aspect ratios.
npx skill4agent add agntswrm/agent-media image-cropagent-media image crop --in <path> --width <px> --height <px> [options]| Option | Required | Description |
|---|---|---|
| Yes | Input file path or URL |
| Yes | Width of crop area in pixels |
| Yes | Height of crop area in pixels |
| No | Focal point X position 0-100 (default: 50 = center) |
| No | Focal point Y position 0-100 (default: 50 = center) |
| No | DPI/density for output (default: 300) |
| No | Output path, filename or directory (default: ./) |
| No | Provider to use (default: local) |
{
"ok": true,
"media_type": "image",
"action": "crop",
"provider": "local",
"output_path": "cropped_123_abc.png",
"mime": "image/png",
"bytes": 45678
}agent-media image crop --in photo.jpg --width 800 --height 600agent-media image crop --in photo.jpg --width 800 --height 600 --focus-x 20 --focus-y 30agent-media image crop --in https://example.com/image.jpg --width 1024 --height 768 --out ./output