Skip to main content
Glama

clear_frame

Remove all pixels from a specific animation frame in pixel art projects to reset or prepare for new artwork.

Instructions

Clear all pixels in a frame

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject identifier
layerIndexNoLayer index (default: 0)
frameIndexNoFrame index (default: 0)

Implementation Reference

  • The handler method that clears all pixels in a specific frame of a Piskel project.
    private clearFrameTool(
      projectId: string,
      layerIndex: number,
      frameIndex: number
    ): object {
      const piskel = this.getProject(projectId);
      const frame = this.getFrame(projectId, layerIndex, frameIndex);
      const width = piskel.getWidth();
      const height = piskel.getHeight();
    
      for (let y = 0; y < height; y++) {
        for (let x = 0; x < width; x++) {
          frame.setPixel(x, y, 0);
        }
      }
    
      return { success: true, pixelsCleared: width * height };
  • Registration of the 'clear_frame' tool, including its schema definition.
    name: 'clear_frame',
    description: 'Clear all pixels in a frame',
    inputSchema: {
      type: 'object',
      properties: {
        projectId: {
          type: 'string',
          description: 'Project identifier',
        },
        layerIndex: {
          type: 'number',
          description: 'Layer index (default: 0)',
        },
        frameIndex: {
          type: 'number',
          description: 'Frame index (default: 0)',
        },

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/yafeiaa/piskel-mcp-server'

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