pixel-surgeon

v1.1.1
io.github.j-east/pixel-surgeon Checked 5 days ago Published 6 months ago

AI image and video generation, editing, and region repair via Gemini, OpenAI, and Grok.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_images

List image and video files in the shared pixel-surgeon directory (/home/runner/Pictures/pixel-surgeon). Use this to find images available for editing.

save_image

Copy an image file into the shared pixel-surgeon directory (/home/runner/Pictures/pixel-surgeon) so it can be used with edit_image. Use this when the user wants to edit an image that exists elsewhere on their filesystem.

ParameterTypeDescription
source_path *stringAbsolute path to the image file to import

generate_images

Generate multiple images in parallel. Supports Gemini and OpenAI models — pass the model param to choose. Returns the generated images and any accompanying text. Full-resolution images are viewable in the browser viewer.

ParameterTypeDescription
prompts *arrayArray of text prompts, one per image to generate (1-8 images)
aspect_ratiostringAspect ratio for all generated images
image_sizestringImage resolution
modelstringModel to use. Available: 'gemini-3.1-flash-image' (Gemini 3.1 Flash Image), 'gemini-2.5-flash-image' (Gemini 2.5 Flash Image), 'gpt-image-1' (GPT Image 1 (OpenAI)), 'gpt-image-2' (GPT Image 2 (OpenAI)…
stylestringOptional style preset to apply. When set, the style's prompt prefix is prepended and its default aspect ratio is used (unless you explicitly set one). Available styles: • neo-brutalist — Neo-brut…

generate_image

Generate a single image. Supports Gemini and OpenAI models — pass the model param to choose. Full-resolution image is viewable in the browser viewer.

ParameterTypeDescription
prompt *stringText prompt describing the image to generate
aspect_ratiostringAspect ratio for the image
image_sizestringImage resolution
modelstringModel to use. Available: 'gemini-3.1-flash-image' (Gemini 3.1 Flash Image), 'gemini-2.5-flash-image' (Gemini 2.5 Flash Image), 'gpt-image-1' (GPT Image 1 (OpenAI)), 'gpt-image-2' (GPT Image 2 (OpenAI)…
stylestringOptional style preset to apply. When set, the style's prompt prefix is prepended and its default aspect ratio is used (unless you explicitly set one). Available styles: • neo-brutalist — Neo-brut…

generate_video

Generate a video using Google's Veo 3. Returns an MP4 video file. Video generation takes 1-3 minutes — the tool will poll until complete. Veo 3 generates both video and ambient audio. Videos are saved to the shared directory and viewable in the browser viewer.

ParameterTypeDescription
prompt *stringText prompt describing the video to generate. Be descriptive about motion, camera angles, lighting, and scene details for best results.
aspect_ratiostringAspect ratio — 16:9 for landscape, 9:16 for portrait/vertical
durationstringVideo duration in seconds

edit_image

Edit an existing image. Supports Gemini and OpenAI models — pass the model param to choose. Provide the filename of an image in /home/runner/Pictures/pixel-surgeon (use list_images to see available files, or save_image to import one first). The MCP reads the file directly — do NOT pass base64 image data.

ParameterTypeDescription
filename *stringFilename of the source image in /home/runner/Pictures/pixel-surgeon (e.g. "2026-03-17T17-47-31-152Z_59f735df.png")
prompt *stringText prompt describing the edits to make to the image
aspect_ratiostringAspect ratio for the output image
image_sizestringOutput image resolution
modelstringModel to use. Available: 'gemini-3.1-flash-image' (Gemini 3.1 Flash Image), 'gemini-2.5-flash-image' (Gemini 2.5 Flash Image), 'gpt-image-1' (GPT Image 1 (OpenAI)), 'gpt-image-2' (GPT Image 2 (OpenAI)…
stylestringOptional style preset to apply. When set, the style's prompt prefix is prepended and its default aspect ratio is used (unless you explicitly set one). Available styles: • neo-brutalist — Neo-brut…

fix_image

Fix an image that has glitched or garbled text by splitting it into tiles, re-rendering each tile, and stitching them back together. This works because smaller sections have less text for the model to handle at once. Use this when a generated image has text artifacts or overloaded text regions.

ParameterTypeDescription
filename *stringFilename of the source image in /home/runner/Pictures/pixel-surgeon
gridstringHow to split the image: cols x rows
image_sizestringResolution for each tile
modelstringModel to use. Available: 'gemini-3.1-flash-image' (Gemini 3.1 Flash Image), 'gemini-2.5-flash-image' (Gemini 2.5 Flash Image), 'gpt-image-1' (GPT Image 1 (OpenAI)), 'gpt-image-2' (GPT Image 2 (OpenAI)…
promptstringInstructions for fixing each tile

fix_region

Fix a specific region of an image by cropping it out, sending it for repair, and reinserting it. The crop is automatically snapped to the nearest supported aspect ratio. Use this when only part of an image has glitched text or artifacts — more precise than fix_image's grid approach.

ParameterTypeDescription
filename *stringFilename of the source image in /home/runner/Pictures/pixel-surgeon
height *numberHeight of region as percentage of image height (1-100)
width *numberWidth of region as percentage of image width (1-100)
x *numberLeft edge of region as percentage of image width (0-100)
y *numberTop edge of region as percentage of image height (0-100)
image_sizestringResolution for the cropped region
modelstringModel to use. Available: 'gemini-3.1-flash-image' (Gemini 3.1 Flash Image), 'gemini-2.5-flash-image' (Gemini 2.5 Flash Image), 'gpt-image-1' (GPT Image 1 (OpenAI)), 'gpt-image-2' (GPT Image 2 (OpenAI)…
promptstringInstructions for fixing the selected region

interactive_fix

Opens an image in a browser-based crop tool where the user can draw a rectangle around the region to fix, add notes/instructions, and submit. The tool waits for the user's selection, then sends the cropped region for repair and composites it back into the original image. Best for precise, user-guided fixes.

ParameterTypeDescription
filename *stringFilename of the source image in /home/runner/Pictures/pixel-surgeon
image_sizestringResolution for the cropped region
modelstringModel to use. Available: 'gemini-3.1-flash-image' (Gemini 3.1 Flash Image), 'gemini-2.5-flash-image' (Gemini 2.5 Flash Image), 'gpt-image-1' (GPT Image 1 (OpenAI)), 'gpt-image-2' (GPT Image 2 (OpenAI)…

remove_background

Remove a background color from an image and make it transparent. Outputs a PNG with alpha channel. The image must already exist in /home/runner/Pictures/pixel-surgeon (use save_image to import first).

ParameterTypeDescription
filename *stringFilename of the source image in /home/runner/Pictures/pixel-surgeon
colorstringTarget background color as hex (e.g. "#FFFFFF" for white, "#000000" for black, "#FF0000" for red). Default: white.
thresholdnumberHow far from the target color a pixel can be and still count as background (0 = exact match only, 30 = default, higher = more aggressive)

trace_to_svg

Convert a raster image to SVG using potrace vectorization. Best for line art, diagrams, logos, and high-contrast images. The image must already exist in /home/runner/Pictures/pixel-surgeon (use save_image to import first).

ParameterTypeDescription
filename *stringFilename of the source image in /home/runner/Pictures/pixel-surgeon
invertbooleanInvert the image before tracing (useful for light-on-dark images)
thresholdnumberBrightness threshold for black/white conversion (0-255). Lower = more black. -1 = auto-detect. Default: auto.
turdsizenumberSuppress speckles up to this size (in pixels). Default: 2.