imageport
v0.1.0Local image tools via ImageMagick: metadata, resize, convert, crop, rotate.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_image_metadata
Read metadata for an image file: format, width, height, color space, and file size.
| Parameter | Type | Description |
|---|---|---|
input * | string | Path to the image file to read metadata from. |
resize_image
Resize an image to the given width and/or height, preserving aspect ratio, and write it to the output path.
| Parameter | Type | Description |
|---|---|---|
input * | string | Path to the source image file to resize. |
output * | string | Path where the resized image will be written. |
height | number | Target height in pixels. Optional; at least one of width and height is required, and aspect ratio is preserved. |
width | number | Target width in pixels. Optional; at least one of width and height is required, and aspect ratio is preserved. |
convert_image
Convert an image to another format (png, jpg, webp, gif, avif, bmp, tiff) and write it to the output path.
| Parameter | Type | Description |
|---|---|---|
format * | string | Target image format: one of png, jpg, webp, gif, avif, bmp, or tiff. |
input * | string | Path to the source image file to convert. |
output * | string | Path where the converted image will be written. Its extension is replaced by the target format when they differ. |
crop_image
Crop a width x height region starting at offset x, y and write it to the output path.
| Parameter | Type | Description |
|---|---|---|
height * | number | Height in pixels of the crop region. Must be greater than 0. |
input * | string | Path to the source image file to crop. |
output * | string | Path where the cropped image will be written. |
width * | number | Width in pixels of the crop region. Must be greater than 0. |
x * | number | Horizontal offset in pixels of the crop region's starting corner. Must be 0 or greater. |
y * | number | Vertical offset in pixels of the crop region's starting corner. Must be 0 or greater. |
rotate_image
Rotate an image by the given angle in degrees and write it to the output path.
| Parameter | Type | Description |
|---|---|---|
angle * | number | Rotation angle in degrees. |
input * | string | Path to the source image file to rotate. |
output * | string | Path where the rotated image will be written. |