openai-vision
Analyze images and multi-frame sequences using OpenAI GPT vision models
Install / Use
npx skills add benchflow-ai/skillsbench --skill openai-visionInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
AI & Machine LearningSupported Platforms
Our assessment of openai-vision
openai-vision scores 91/100 on our quality scale, 255th of 875 AI & Machine Learning skills we index (top 30%).
Its SKILL.md is 20 KB long, well organised into 30 sections with 15 code examples: a thorough specification that gives an agent plenty to work with.
With 1,813 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so openai-vision is actively maintained.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
openai-vision compared with similar skills
All 4 of these similar skills score higher than openai-vision; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| openai-vision (this skill)by benchflow-ai | 91 | 1.8k | 2mo ago | SKILL.md |
| claude-memby thedotmack | 100 | 95.0k | today | CLAUDE.md |
| Understand-Anythingby Egonex-AI | 100 | 84.8k | 2d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 74.2k | today | CLAUDE.md |
| CowAgentby zhayujie | 100 | 47.2k | today | CLAUDE.md |
Frequently asked questions
- How do I install openai-vision?
- Run
npx skills add benchflow-ai/skillsbench --skill openai-vision. The install tabs above show the steps for each supported agent. - Which AI agents does openai-vision work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is openai-vision safe to use?
- It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is openai-vision still maintained?
- The repository was last updated about 2 months ago, so openai-vision is actively maintained.
Skill content
View source on GitHubname: openai-vision description: Analyze images and multi-frame sequences using OpenAI GPT vision models
OpenAI Vision Analysis Skill
Purpose
This skill enables image analysis, scene understanding, text extraction, and multi-frame comparison using OpenAI's vision-capable GPT models (e.g., gpt-4o, gpt-4o-mini). It supports single images, multiple images for comparison, and sequential frames for temporal analysis.
When to Use
- Analyzing image content (objects, scenes, colors, spatial relationships)
- Extracting and reading text from images (OCR via vision models)
- Comparing multiple images to detect differences or changes
- Processing video frames to understand temporal progression
- Generating detailed image descriptions or captions
- Answering questions about visual content
Required Libraries
The following Python libraries are required:
from openai import OpenAI
import base64
import json
import os
from pathlib import Path
Input Requirements
- File formats: JPG, JPEG, PNG, WEBP, non-animated GIF
- Image sources: URL, Base64-encoded data, or local file paths
- Size limits: Up to 20MB per image; total request payload under 50MB
- Maximum images: Up to 500 images per request
- Image quality: Clear, legible content; avoid watermarks or heavy distortions
Output Schema
Analysis results should be returned as valid JSON conforming to this schema:
{
"success": true,
"images_analyzed": 1,
"analysis": {
"description": "A detailed scene description...",
"objects": [
{"name": "car", "color": "red", "position": "foreground center"},
{"name": "tree", "count": 3, "position": "background"}
],
"text_content": "Any text visible in the image...",
"colors": ["blue", "green", "white"],
"scene_type": "outdoor/urban"
},
"comparison": {
"differences": ["Object X appeared", "Color changed from A to B"],
"similarities": ["Background unchanged", "Layout consistent"]
},
"metadata": {
"model_used": "gpt-4o",
"detail_level": "high",
"token_usage": {"prompt": 1500, "completion": 200}
},
"warnings": []
}
Field Descriptions
success: Boolean indicating whether analysis completedimages_analyzed: Number of images processed in the requestanalysis.description: Natural language description of the image contentanalysis.objects: Array of detected objects with attributesanalysis.text_content: Any text extracted from the imageanalysis.colors: Dominant colors identifiedanalysis.scene_type: Classification of the scenecomparison: Present when multiple images are analyzed; describes differences and similaritiesmetadata.model_used: The GPT model used for analysismetadata.detail_level: Resolution level used (low,high, orauto)metadata.token_usage: Token consumption for cost trackingwarnings: Array of any issues or limitations encountered
Code Examples
Basic Image Analysis from URL
from openai import OpenAI
client = OpenAI()
def analyze_image_url(image_url, prompt="Describe this image in detail."):
"""Analyze an image from a URL using GPT-4o vision."""
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": prompt},
{
"type": "image_url",
"image_url": {
"url": image_url,
"detail": "high"
}
}
]
}
],
max_tokens=1000
)
return response.choices[0].message.content
Image Analysis from Local File (Base64)
from openai import OpenAI
import base64
client = OpenAI()
def encode_image_to_base64(image_path):
"""Encode a local image file to base64."""
with open(image_path, "rb") as image_file:
return base64.standard_b64encode(image_file.read()).decode("utf-8")
def get_image_media_type(image_path):
"""Determine the media type based on file extension."""
ext = image_path.lower().split('.')[-1]
media_types = {
'jpg': 'image/jpeg',
'jpeg': 'image/jpeg',
'png': 'image/png',
'gif': 'image/gif',
'webp': 'image/webp'
}
return media_types.get(ext, 'image/jpeg')
def analyze_local_image(image_path, prompt="Describe this image in detail."):
"""Analyze a local image file using GPT-4o vision."""
base64_image = encode_image_to_base64(image_path)
media_type = get_image_media_type(image_path)
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": prompt},
{
"type": "image_url",
"image_url": {
"url": f"data:{media_type};base64,{base64_image}",
"detail": "high"
}
}
]
}
],
max_tokens=1000
)
return response.choices[0].message.content
Multi-Image Comparison
from openai import OpenAI
import base64
client = OpenAI()
def compare_images(image_paths, comparison_prompt=None):
"""Compare multiple images and identify differences."""
if comparison_prompt is None:
comparison_prompt = (
"Compare these images carefully. "
"List all differences and similarities you observe. "
"Describe any changes in objects, colors, positions, or text."
)
content = [{"type": "text", "text": comparison_prompt}]
for i, image_path in enumerate(image_paths):
base64_image = encode_image_to_base64(image_path)
media_type = get_image_media_type(image_path)
# Add label for each image
content.append({
"type": "text",
"text": f"Image {i + 1}:"
})
content.append({
"type": "image_url",
"image_url": {
"url": f"data:{media_type};base64,{base64_image}",
"detail": "high"
}
})
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": content}],
max_tokens=2000
)
return response.choices[0].message.content
Multi-Frame Video Analysis
from openai import OpenAI
import base64
from pathlib import Path
client = OpenAI()
def analyze_video_frames(frame_paths, analysis_prompt=None):
"""Analyze a sequence of video frames for temporal understanding."""
if analysis_prompt is None:
analysis_prompt = (
"These are sequential frames from a video. "
"Describe what is happening over time. "
"Identify any motion, changes, or events that occur across the frames."
)
content = [{"type": "text", "text": analysis_prompt}]
for i, frame_path in enumerate(frame_paths):
base64_image = encode_image_to_base64(frame_path)
media_type = get_image_media_type(frame_path)
content.append({
"type": "text",
"text": f"Frame {i + 1}:"
})
content.append({
"type": "image_url",
"image_url": {
"url": f"data:{media_type};base64,{base64_image}",
"detail": "auto" # Use auto for frames to balance cost
}
})
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": content}],
max_tokens=2000
)
return response.choices[0].message.content
Full Analysis with JSON Output
from openai import OpenAI
import base64
import json
import os
client = OpenAI()
def analyze_image_to_json(image_path, extract_text=True):
"""Perform comprehensive image analysis and return structured JSON."""
filename = os.path.basename(image_path)
prompt = """Analyze this image and return a JSON object with the following structure:
{
"description": "detailed scene description",
"objects": [{"name": "object name", "attributes": "color, size, position"}],
"text_content": "any visible text or null if none",
"colors": ["dominant", "colors"],
"scene_type": "indoor/outdoor/abstract/etc",
"people_count": 0,
"notable_features": ["list of notable visual elements"]
}
Return ONLY valid JSON, no other text."""
try:
base64_image = encode_image_to_base64(image_path)
media_type = get_image_media_type(image_path)
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": prompt},
{
"type": "image_url",
"image_url": {
"url": f"data:{media_type};base64,{base64_image}",
"detail": "high"
}
}
]
}
],
max_tokens=1500
)
# Parse the response as JSON
analysis_text = response.choices[0].message.content
# Remove markdown code blocks if present
if analysis_text.startswith("```"):
analysis_text = analysis_text.split("```")[1]
if analysis_text.startswith("json"):
analysis_text = analysis_text[4:]
analysis = json.loads(analysis_text.strip())
result = {
"success": True,
"filename": filename,
"analysis": analysis,
"metadata": {
"model_used": "gpt-4o",
"detail_level": "high",
"token_usage": {
"prompt": response.usage.prompt_tokens,
"completion": response.usage.completion_tokens
}
},
"warnings": []
}
except json.JSONDecodeError as e:
result = {
"success": False,
"filename": filename,
"analysis": {"raw_response": response.choices[0].message.content},
"metadata": {"model_used": "gpt-4o"},
"warnings": [f"Failed to parse JSON: {str(e)}"]
}
except Exception as e:
result = {
"success": False,
"filename": filename,
"analysis": {},
"metadata": {},
"warnings": [f"Analysis failed: {str(e)}"]
}
return result
# Usage
result = analyze_image_to_json("photo.jpg")
print(json.dumps(result, indent=2))
Batch Processing Directory
from openai import OpenAI
import base64
import json
from pathlib import Path
client = OpenAI()
def process_image_directory(directory_path, output_file, prompt=None):
"""Process all images in a directory and save results."""
if prompt is None:
prompt = "Describe this image briefly, including any visible text."
image_extensions = {'.jpg', '.jpeg', '.png', '.webp', '.gif'}
results = []
for file_path in sorted(Path(directory_path).iterdir()):
if file_path.suffix.lower() in image_extensions:
print(f"Processing: {file_path.name}")
try:
analysis = analyze_local_image(str(file_path), prompt)
results.append({
"filename": file_path.name,
"success": True,
"analysis": analysis
Truncated for display — read the full file on GitHub.
Related Skills
claude-mem
95.0kPersistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Understand-Anything
84.8kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
headroom
74.2kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
CowAgent
47.2kOpen-source personal AI assistant & Agent Harness. Plans tasks, runs tools and skills, self-evolves with memory and knowledge. Multi-agent, multi-model, multi-channel. Lightweight, extensible, one-line install.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
