Attach Image

SkillMedia

attach-image is a skill that loads an image file from disk into the model's context as a viewable attachment, so a vision-capable model can directly see it. It is meant for screenshots, diagrams, charts, photos, and scanned pages, and it supports PNG, JPEG, GIF, and WebP. Large images are resized or compressed before loading, and the original file is left untouched.

Then ask your AI: use the Attach Image skill

Details

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

Have a vision-capable model available, since the skill errors clearly if the current model is not vision-capable.

What your AI can do with it

  • Load a PNG, JPEG, GIF, or WebP file into the model's context
  • Attach several images at once with attach_image("a.png", "b.jpg")
  • Resize and compress large images before they are loaded
  • Flatten animated images to their first frame when compression is needed
  • Composite transparent images onto a neutral gray background when compressing
  • Reject extremely large images by pixel count before full processing

Getting started

  1. Have a vision-capable model available, since the skill errors clearly if the current model is not vision-capable.
  2. Make sure the image file is on disk in PNG, JPEG, GIF, or WebP format.
  3. Call the prepared attach_image import in the Python kernel, for example print(await attach_image("diagram.png")).
  4. Pass more than one path to attach several images in the same call, for example attach_image("a.png", "b.jpg").

What this skill tells your AI

The instructions your AI receives, as published by primeintellect-ai/prime-agent in skills/attach-image/SKILL.md and read by Ahel’s review.

Load on-disk images into the model's context as multimodal attachments. The image is sent to the model the same way a pasted image is, so the model can actually look at it.

When to use this

  • The user points at an image file and wants you to look at it.
  • You need to read text, a chart, a diagram, or a layout from an image.
  • A screenshot needs visual interpretation.

When NOT to use this

For programmatic work on an image — measuring pixels, cropping, resizing, computing a hash, comparing files byte-by-byte — open it in the kernel with a library instead:

from PIL import Image
img = Image.open("diagram.png")
print(img.size)

That path does not put the image in the model's context; it only lets you compute over it. Use attach_image when you need to see the image.

Usage

Call the prepared attach_image import directly in the Python kernel:

print(await attach_image("diagram.png"))
print(await attach_image("a.png", "b.jpg"))

The skill automatically resizes and compresses large images before loading them into context. Animated images that need compression are flattened to their first frame. Transparent images that need compression are composited onto a neutral gray background. Extremely large images are rejected by pixel count before full processing. The original file is left untouched.

Supported formats: PNG, JPEG, GIF, WebP. The skill errors if a file is not a supported image, or if the current model is not vision-capable.

Signals

GitHub stars
22k
Forks
2k
Last commit
Oct 2026

Questions

What image formats does it support?
PNG, JPEG, GIF, and WebP. The skill errors if a file is not a supported image.
Does it require a vision-capable model?
Yes. The skill errors clearly if the current model is not vision-capable.
What happens to large images?
The skill automatically resizes and compresses them before loading them into context. Extremely large images are rejected by pixel count before full processing.
Does it change the original file?
No. The original file is left untouched.
Advanced
Item type
skill
Key
attach-image
Source
github.com/primeintellect-ai/prime-agent