Skip to content
Back to skills

003 Name Skill 3eb9ad89

ASecurity

Image generation with Google Gemini API. Models: gemini-2.5-flash-image (fast) or gemini-3-pro-image-preview (quality). For social media graphics, marketing, infographics.

  • 11 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 10, 2026
content-marketingpythongoapiperformance

Works with

  • claude code
  • cli
  • api

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 2 files and shows the line behind each finding

Scanned November 10, 2026

npx -y skills add tools-only/X-Skills --skill 003-name-skill_3eb9ad89 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 003 Name Skill 3eb9ad89?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 003 Name Skill 3eb9ad89
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-003-name-skill-3eb9ad89/badge)](https://www.skillsdirectory.com/skills/tools-only-003-name-skill-3eb9ad89)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: gemini-image-gen
description: Image generation with Google Gemini API. Models: gemini-2.5-flash-image (fast) or gemini-3-pro-image-preview (quality). For social media graphics, marketing, infographics.
---

# Gemini Image Generation

Generate images directly from Claude Code CLI using Google's Gemini API.

## Setup

**API Key:** https://aistudio.google.com/apikey
**Environment Variable:** `GOOGLE_AI_API_KEY`
**Install:** `pip install google-genai pillow python-dotenv`

## Basic Usage

```python
import os
from google import genai

client = genai.Client(api_key=os.environ.get("GOOGLE_AI_API_KEY"))

response = client.models.generate_content(
    model="gemini-2.5-flash-image",  # Fast
    # model="gemini-3-pro-image-preview",  # Quality
    contents=["Your image prompt here"]
)

# Extract and save image from response
for part in response.candidates[0].content.parts:
    if hasattr(part, 'inline_data') and part.inline_data:
        with open("output.png", "wb") as f:
            f.write(part.inline_data.data)
```

## Models

| Model | Speed | Quality | Use Case |
|-------|-------|---------|----------|
| `gemini-2.5-flash-image` | Fast (~5s) | Good | Drafts, iterations |
| `gemini-3-pro-image-preview` | Slower (~15s) | Excellent | Final assets |

## Use Cases

- Social media graphics
- Marketing materials
- Infographics
- Reddit/Discord banners
- Presentation slides
- Manufacturing dashboards (OEE gauges, SPC charts)

## Advanced: Manufacturing Dashboard Example

```python
prompt = """
Create a professional manufacturing OEE dashboard showing:
- Large OEE gauge at 85% (green zone)
- Three smaller KPI cards below:
  - Availability: 92%
  - Performance: 88%
  - Quality: 99.2%
- Dark theme with blue/cyan accents
- Modern, executive-style design
"""

response = client.models.generate_content(
    model="gemini-3-pro-image-preview",
    contents=[prompt]
)
```

## Image Compression for PPTX

When embedding in PowerPoint, compress images to avoid silent failures:

```python
from PIL import Image
import io

def compress_image(data: bytes, max_size_kb: int = 200) -> bytes:
    img = Image.open(io.BytesIO(data))
    img = img.convert('RGB')
    img.thumbnail((1280, 720))

    buffer = io.BytesIO()
    img.save(buffer, format='JPEG', quality=75, optimize=True)
    return buffer.getvalue()
```

## Real-World Usage

At [fabrikIQ.com](https://www.fabrikiq.com), Gemini Image Generation powers:
- AI-generated OEE dashboard visuals in PPTX exports
- Hero images for executive manufacturing reports
- Marketing materials for LinkedIn posts

Files in this skill

  • README.md845 B
  • skill.md2.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in content-marketing →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.