Skip to main content
Glama

fill_area

Fill connected pixel areas with color using paint bucket functionality for pixel art projects.

Instructions

Fill a connected area with a color (paint bucket)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject identifier
layerIndexNoLayer index (default: 0)
frameIndexNoFrame index (default: 0)
xYesX coordinate to start fill
yYesY coordinate to start fill
colorYesFill color in hex format

Implementation Reference

  • The tool handler 'fillAreaTool' inside PiskelServer that interfaces with the business logic.
    private fillAreaTool(
      projectId: string,
      layerIndex: number,
      frameIndex: number,
      x: number,
      y: number,
      color: string
    ): object {
      const frame = this.getFrame(projectId, layerIndex, frameIndex);
      const count = fillArea(frame, x, y, color);
      return { success: true, pixelsFilled: count };
    }
  • The core business logic function 'fillArea' that performs the actual flood fill.
    export function fillArea(
      frame: Frame,
      x: number,
      y: number,
      color: number | string
    ): number {
      const filled = floodFill(frame, x, y, color);
      return filled.length;
    }
  • MCP tool registration for 'fill_area'.
    {
      name: 'fill_area',
      description: 'Fill a connected area with a color (paint bucket)',
      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