Skip to main content
Glama

rotate_image

Rotate images by a specified angle, adjust background color for exposed areas, and save the output. Ideal for precise image orientation adjustments.

Instructions

Rotate an image by specified degrees

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
angleYesRotation angle in degrees (positive = clockwise)
backgroundNoBackground color for exposed areas (hex or named color)#000000
inputPathYesPath to input image
outputPathYesPath to save rotated image

Implementation Reference

  • Handler for rotate_image tool: extracts parameters, ensures output directory exists, rotates the image using sharp.rotate() with specified angle and background, saves to outputPath, and returns success message.
    case 'rotate_image': { const { inputPath, outputPath, angle, background = '#000000' } = args; await fs.mkdir(path.dirname(outputPath), { recursive: true }); await sharp(inputPath) .rotate(angle, { background }) .toFile(outputPath); return { content: [ { type: 'text', text: `Image rotated ${angle}° successfully. Saved to: ${outputPath}` } ] }; }
  • src/index.ts:117-137 (registration)
    Registration of the rotate_image tool in the listTools response, including name, description, and input schema definition for validation.
    { name: 'rotate_image', description: 'Rotate an image by specified degrees', inputSchema: { type: 'object', properties: { inputPath: { type: 'string', description: 'Path to input image' }, outputPath: { type: 'string', description: 'Path to save rotated image' }, angle: { type: 'number', description: 'Rotation angle in degrees (positive = clockwise)' }, background: { type: 'string', description: 'Background color for exposed areas (hex or named color)', default: '#000000' } }, required: ['inputPath', 'outputPath', 'angle'] } },

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/flowy11/imagician'

If you have feedback or need assistance with the MCP directory API, please join our Discord server