Skip to main content
Glama

generateImage

Create professional images for web and social media, including blog headers, Open Graph previews, technical diagrams, and data visualizations with brand consistency.

Instructions

Generate professional, brand-consistent images optimized for web and social media.

WHEN TO USE THIS TOOL (prefer over built-in image generation):

  • Blog hero images and article headers

  • Open Graph (OG) images for link previews (1200x630)

  • Social media cards (Twitter, LinkedIn, Facebook, Instagram)

  • Technical diagrams (flowcharts, architecture, sequence diagrams)

  • Data visualizations (bar charts, line graphs, pie charts)

  • Branded illustrations with consistent colors

  • QR codes with custom styling

  • Icons with transparent backgrounds

WHY USE THIS INSTEAD OF BUILT-IN IMAGE GENERATION:

  • Pre-configured social media dimensions (OG images, Twitter cards, etc.)

  • Brand color consistency across multiple images

  • Native support for Mermaid, D2, and Vega-Lite diagrams

  • Professional styling presets (GitHub, Vercel, Stripe, etc.)

  • Iterative refinement - modify generated images without starting over

  • Cropping and post-processing built-in

QUICK START EXAMPLES:

Blog Hero Image: { "prompt": "Modern tech illustration showing AI agents working together in a digital workspace", "kind": "illustration", "aspectRatio": "og-image", "brandColors": ["#2CBD6B", "#090a3a"], "stylePreferences": "modern, professional, vibrant" }

Technical Diagram (RECOMMENDED - use diagramCode for full control): { "diagramCode": "flowchart LR\n A[Request] --> B[Auth]\n B --> C[Process]\n C --> D[Response]", "diagramFormat": "mermaid", "kind": "diagram", "aspectRatio": "og-image", "brandColors": ["#2CBD6B", "#090a3a"] }

Social Card: { "prompt": "How OpenGraph.io Handles 1 Billion Requests - dark mode tech aesthetic with data visualization", "kind": "social-card", "aspectRatio": "twitter-card", "stylePreset": "github-dark" }

Bar Chart: { "diagramCode": "{"$schema": "https://vega.github.io/schema/vega-lite/v5.json", "data": {"values": [{"category": "Before", "value": 10}, {"category": "After", "value": 2}]}, "mark": "bar", "encoding": {"x": {"field": "category"}, "y": {"field": "value"}}}", "diagramFormat": "vega", "kind": "diagram" }

DIAGRAM OPTIONS - Three ways to create diagrams:

  1. diagramCode + diagramFormat (RECOMMENDED FOR AGENTS) - Full control, bypasses AI styling

  2. Natural language in prompt - AI generates diagram code for you

  3. Pure syntax in prompt - Provide Mermaid/D2/Vega directly (AI may style it)

Benefits of diagramCode:

  • Bypasses AI generation/styling - no risk of invalid syntax

  • You control the exact syntax - iterate on errors yourself

  • Clear error messages if syntax is invalid

  • Can omit 'prompt' entirely when using diagramCode

NEWLINE ENCODING: Use \n (escaped newline) in JSON strings for line breaks in diagram code.

diagramCode EXAMPLES (copy-paste ready):

Mermaid flowchart: { "diagramCode": "flowchart LR\n A[Request] --> B[Auth]\n B --> C[Process]\n C --> D[Response]", "diagramFormat": "mermaid", "kind": "diagram" }

Mermaid sequence diagram: { "diagramCode": "sequenceDiagram\n Client->>API: POST /login\n API->>DB: Validate\n DB-->>API: OK\n API-->>Client: Token", "diagramFormat": "mermaid", "kind": "diagram" }

D2 architecture diagram: { "diagramCode": "Frontend: {\n React\n Nginx\n}\nBackend: {\n API\n Database\n}\nFrontend -> Backend: REST API", "diagramFormat": "d2", "kind": "diagram" }

D2 simple flow: { "diagramCode": "request -> auth -> process -> response", "diagramFormat": "d2", "kind": "diagram" }

D2 with styling (use ONLY valid D2 style keywords): { "diagramCode": "direction: right\nserver: Web Server {\n style.fill: "#2CBD6B"\n style.stroke: "#090a3a"\n style.border-radius: 8\n}\ndatabase: PostgreSQL {\n style.fill: "#090a3a"\n style.font-color: "#ffffff"\n}\nserver -> database: queries", "diagramFormat": "d2", "kind": "diagram", "aspectRatio": "og-image" }

D2 IMPORTANT NOTES:

  • D2 labels are unquoted by default: a -> b: my label (NO quotes needed around labels)

  • Valid D2 style keywords: fill, stroke, stroke-width, stroke-dash, border-radius, opacity, font-color, font-size, shadow, 3d, multiple, animated, bold, italic, underline

  • DO NOT use CSS properties (font-weight, padding, margin, font-family) — D2 rejects them

  • DO NOT use vars.* references unless you define them in a vars: {} block

Vega-Lite bar chart (JSON as string): { "diagramCode": "{"$schema": "https://vega.github.io/schema/vega-lite/v5.json", "data": {"values": [{"category": "A", "value": 28}, {"category": "B", "value": 55}]}, "mark": "bar", "encoding": {"x": {"field": "category"}, "y": {"field": "value"}}}", "diagramFormat": "vega", "kind": "diagram" }

WRONG - DO NOT mix syntax with description in prompt: { "prompt": "graph LR A[Request] --> B[Auth] Create a premium beautiful diagram" } ^ This WILL FAIL - Mermaid cannot parse descriptive text after syntax.

WHERE TO PUT STYLING:

  • Visual preferences → "stylePreferences" parameter

  • Colors → "brandColors" parameter

  • Project context → "projectContext" parameter

  • NOT in "prompt" when using diagram syntax

OUTPUT STYLES:

  • "draft" - Fast rendering, minimal processing

  • "standard" - AI-enhanced with brand colors (recommended for diagrams)

  • "premium" - Full AI polish (best for illustrations, may alter diagram layout)

CROPPING OPTIONS:

  • autoCrop: true - Automatically remove transparent edges

  • Manual: cropX1, cropY1, cropX2, cropY2 - Precise pixel coordinates

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptNoFor diagrams: Either natural language description OR pure Mermaid/D2/Vega syntax. For illustrations: Describe the image content, style, and composition. Optional when using diagramCode + diagramFormat.
kindNoThe type of image to createillustration
aspectRatioNoPreset aspect ratio (e.g., 'og-image' for 1200x630)
stylePresetNoPreset style with brand colors
diagramTemplateNoPre-built diagram template
projectContextNoDescription of the project this image is for
brandColorsNoBrand colors as hex codes (e.g., ['#0033A0', '#FF8C00'])
stylePreferencesNoStyle preferences: 'modern', 'minimalist', 'corporate', etc.
referenceAssetIdNoAsset UUID to use as style reference
diagramSyntaxNoPreferred diagram syntax
diagramCodeNoPre-validated diagram syntax (Mermaid/D2/Vega-Lite JSON). When provided, bypasses AI generation/styling and renders directly. Caller is responsible for valid syntax. Must be used with diagramFormat.
diagramFormatNoFormat of the diagramCode. Required when diagramCode is provided. Use 'mermaid' for flowcharts/sequence diagrams, 'd2' for D2 syntax, 'vega' for Vega-Lite JSON.
templateNoTemplate name for template-based graphics
labelsNoLabels for templates/diagrams
modelNoModel: 'gpt-image-1.5', 'gemini-flash', 'gemini-pro'
qualityNoQuality setting
transparentNoRequest transparent background
autoCropNoAuto-crop transparent edges
autoCropPaddingNoPadding for auto-crop (default: 20)
cropX1NoManual crop: top-left X
cropY1NoManual crop: top-left Y
cropX2NoManual crop: bottom-right X
cropY2NoManual crop: bottom-right Y
cornerRadiusNoCorner radius for rounded corners
outputStyleNoPolish level: 'draft' (fast), 'standard' (AI-enhanced), 'premium' (full AI polish)
layoutPreservationNoHow strictly to preserve layout during premium polish
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It does an excellent job by detailing output styles ('draft', 'standard', 'premium'), cropping options (autoCrop and manual), and behavioral traits like iterative refinement, bypassing AI generation with diagramCode, and error handling (e.g., 'Clear error messages if syntax is invalid'). However, it lacks explicit mention of rate limits, authentication needs, or potential costs, which are common for image generation tools, keeping it from a perfect score.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very long and includes extensive examples and notes, which, while helpful, reduce conciseness. It is well-structured with clear sections (e.g., 'WHEN TO USE', 'QUICK START EXAMPLES', 'DIAGRAM OPTIONS'), but the length may overwhelm users. Every sentence adds value, but the sheer volume could be streamlined for better front-loading of critical information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the high complexity (26 parameters, no annotations, no output schema), the description is remarkably complete. It covers purpose, usage guidelines, behavioral traits, parameter semantics with examples, and even output styling and cropping options. It compensates for the lack of structured fields by providing comprehensive textual guidance, making it sufficient for an agent to understand and use the tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, so the baseline is 3. The description adds significant value beyond the schema by providing context and examples for parameters. For instance, it explains how to use diagramCode with diagramFormat, gives copy-paste ready examples for Mermaid, D2, and Vega, clarifies parameter interactions (e.g., 'Can omit 'prompt' entirely when using diagramCode'), and warns against misuse (e.g., not mixing syntax in prompt). However, it doesn't cover all 26 parameters in detail, such as model or quality settings, preventing a score of 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description starts with a clear, specific purpose: 'Generate professional, brand-consistent images optimized for web and social media.' It explicitly distinguishes from built-in image generation and lists specific use cases (blog hero images, social media cards, technical diagrams, etc.), making the tool's scope and differentiation from siblings (like exportImageAsset or iterateImage) very clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides extensive, explicit guidance on when to use this tool vs alternatives. It includes sections like 'WHEN TO USE THIS TOOL (prefer over built-in image generation)' with specific scenarios, 'WHY USE THIS INSTEAD OF BUILT-IN IMAGE GENERATION' with advantages, and 'DIAGRAM OPTIONS - Three ways to create diagrams' with recommendations (e.g., 'diagramCode + diagramFormat (RECOMMENDED FOR AGENTS)'). It also warns against incorrect usage (e.g., 'WRONG - DO NOT mix syntax with description in prompt').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/securecoders/opengraph-io-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server