Skip to main content
Glama

draw_pixel

Draw a single pixel at specified coordinates with a chosen color in pixel art projects. Use this tool to place individual pixels for detailed editing, corrections, or precise artwork creation within animation frames and layers.

Instructions

Draw a single pixel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject identifier
layerIndexNoLayer index (default: 0)
frameIndexNoFrame index (default: 0)
xYesX coordinate
yYesY coordinate
colorYesColor in hex format (e.g., "#FF0000" or "rgba(255,0,0,1)")

Implementation Reference

  • The PiskelServer method that acts as the handler for the 'draw_pixel' MCP tool, executing the core drawing logic.
    private drawPixelTool(
      projectId: string,
      layerIndex: number,
      frameIndex: number,
      x: number,
      y: number,
      color: string
    ): object {
      const frame = this.getFrame(projectId, layerIndex, frameIndex);
      const success = drawPixel(frame, x, y, color);
      return { success, x, y, color };
    }
  • The core drawing function that implements the pixel-setting logic, which is called by the handler.
    export function drawPixel(
      frame: Frame,
      x: number,
      y: number,
      color: number | string
    ): boolean {
      if (!frame.containsPixel(x, y)) {
        return false;
      }
      frame.setPixel(x, y, color);
      return true;
    }
  • The registration of the 'draw_pixel' tool in the PiskelServer, defining its name, description, and input schema.
    {
      name: 'draw_pixel',
      description: 'Draw a single pixel',
      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