Image generation
Skill puretechnyc/purebrain-skills/skills/content/image-generation
Production-tested Claude Code skills for marketing, operations, and business automation. Built by PureBrain.
npx -y skills add puretechnyc/purebrain-skills --skill image-generationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Generate images for blog banners, social posts, LinkedIn graphics, and marketing materials using AI image generation APIs. Multi-platform sizing, compression workflows, and prompt engineering patterns.
SKILL.md
6.3 KB, ~1.5k tokens by cl100k_base, as published. Nobody here has run it
Image Generation Skill
Purpose: Generate images using AI image generation APIs (Google Gemini, FLUX.2 via Replicate, DALL-E, or similar).
PLATFORM-SPECIFIC REQUIREMENTS
| Platform | Aspect Ratio | Max Size | Format | Resolution |
|---|---|---|---|---|
| Blog header | 16:9 | No limit | PNG | 2K |
| Bluesky | 1:1 SQUARE | <976KB | JPEG | 1K |
| 16:9 | ~5MB | PNG/JPEG | 2K | |
| 16:9 or 1:1 | No limit | PNG | 2K |
Bluesky Compression (MANDATORY for posts)
Bluesky REJECTS images >976KB. Always compress:
from PIL import Image
def compress_for_bluesky(input_path: str, output_path: str):
"""Compress image for Bluesky (<976KB requirement)."""
img = Image.open(input_path)
if img.mode in ('RGBA', 'P'):
img = img.convert('RGB')
img.save(output_path, "JPEG", quality=85, optimize=True)
print(f"Compressed: {output_path}")
Quick Start (Google Gemini)
from google import genai
from google.genai import types
import os
client = genai.Client(api_key=os.environ['GOOGLE_API_KEY'])
# Generate image
response = client.models.generate_content(
model="gemini-3-pro-image-preview",
contents="A digital art piece showing interconnected nodes in a constellation pattern",
config=types.GenerateContentConfig(
response_modalities=['IMAGE'],
image_config=types.ImageConfig(
aspect_ratio="16:9",
image_size="2K"
),
)
)
# Save image
for part in response.parts:
if part.inline_data is not None:
image = part.as_image()
image.save("output.png")
print("Image saved!")
Aspect Ratios
| Ratio | Best For |
|---|---|
1:1 | Social media profile pics, square posts |
16:9 | Blog headers, YouTube thumbnails |
9:16 | Mobile/Stories content |
4:3 | Classic photos |
3:4 | Portrait orientation |
4:5 | LinkedIn portrait posts (max feed space) |
21:9 | Ultrawide banners |
Image Resolution
| Size | Resolution | Best For |
|---|---|---|
1K | 1024px | Social media, quick iterations |
2K | 2048px | Blog headers, general use (recommended) |
4K | 4096px | Print, high-quality needs |
Text in Images
Modern AI image generators (especially Gemini) excel at text rendering. Use this capability.
Great uses for text in images:
- Quote cards: Include the quote directly in the image
- Titles/Headlines: Blog titles, thread hooks
- Infographics: Labels, data points, explanations
- Branding: Your brand name, tagline
- Call-to-action: "Read more", "Thread below"
How to request text:
prompt = """Quote card with the text "Memory is our moat" in bold white typography.
Dark blue gradient background.
Text should be LARGE and CENTERED.
Professional design, clean composition."""
Be explicit: "Write 'HELLO' in bold serif font" creates clearer results than vague requests.
Style Keywords That Work Well
- Photography terms: "35mm prime lens", "macro close-up", "film grain", "bokeh"
- Quality modifiers: "8K quality", "high detail", "professional photography"
- Lighting descriptors: "Rembrandt lighting", "golden hour", "backlit", "dramatic"
Complete Function
import os
from pathlib import Path
from google import genai
from google.genai import types
def generate_image(
prompt: str,
output_path: str = "output.png",
aspect_ratio: str = "16:9",
image_size: str = "2K"
):
"""
Generate an image using an AI image generation API.
Args:
prompt: Text description of the image to generate
output_path: Where to save the image
aspect_ratio: 1:1, 16:9, 9:16, 4:3, 3:4, 21:9
image_size: "1K", "2K", or "4K"
Returns:
Saved file path, or None if generation failed
"""
client = genai.Client(api_key=os.environ['GOOGLE_API_KEY'])
response = client.models.generate_content(
model="gemini-3-pro-image-preview",
contents=prompt,
config=types.GenerateContentConfig(
response_modalities=['IMAGE'],
image_config=types.ImageConfig(
aspect_ratio=aspect_ratio,
image_size=image_size
),
)
)
for part in response.parts:
if part.inline_data is not None:
image = part.as_image()
image.save(output_path)
print(f"Saved to: {output_path}")
return output_path
print("No image generated")
return None
Use Case Examples
Blog Header (16:9, 2K)
generate_image(
prompt="Blog header for article about AI and marketing. Abstract neural network with glowing nodes. Modern tech aesthetic. Include title 'The Future of Marketing' in bold white.",
output_path="blog-header.png",
aspect_ratio="16:9",
image_size="2K"
)
Social Media Post (1:1, 1K)
generate_image(
prompt="Square social media graphic showing AI collaboration. Abstract, modern, professional.",
output_path="social-image.png",
aspect_ratio="1:1",
image_size="1K"
)
Quote Card
generate_image(
prompt='Quote card with text "Data without insight is just noise" in elegant typography. Dark background, golden text, professional design.',
output_path="quote-card.png",
aspect_ratio="1:1",
image_size="2K"
)
Troubleshooting
| Problem | Solution |
|---|---|
| "Model not found" | Verify model ID and API key access |
| Image not saving | Check that you iterate through response.parts correctly |
| Bluesky rejection (>976KB) | Always compress with compress_for_bluesky() before posting |
| Low quality output | Use image_size="2K" or "4K" and add quality modifiers to prompt |
| Bad text rendering | Be very explicit about text content, font style, and placement |
Built by PureBrain -- AI-powered marketing operations.
Want the full suite of 183+ production-tested skills? Start your trial ->
Gives 0 of the 12 instructions most prompt engineering skills give in ~1.5k tokens
Counted across 563 of the 626 authors here whose files we hold, read 2026-08-06
- ask at most three clarifying questionsin 22 of 563, across 15 files
- respond in the user input languagein 14 of 563, across 9 files
- preserve the original intentin 13 of 563, across 11 files
- Establish baseline metrics and collect representative examplesin 12 of 563, across 2 files
- Identify failure modes and prioritize high-impact fixesin 12 of 563, across 2 files
- Apply prompt and workflow improvements with measurable goalsin 12 of 563, across 2 files
- Roll back quickly if quality or safety metrics regressin 12 of 563, across 2 files
- validate changes with tests and roll out in controlled stagesin 12 of 563, across 2 files
- generate quantitative baseline performance reportsin 12 of 563, across 2 files
- create representative test scenariosin 12 of 563, across 2 files
- treat prompts as codein 12 of 563, across 5 files
- test prompts on diverse inputsin 12 of 563, across 8 files
Said here and by no other author read
- match aspect ratio and size to target platform
- compress images below 976KB for Bluesky
- convert RGBA or P mode images to RGB
- save JPEGs using quality 85 and optimize true
- use 2K resolution for blog headers
- specify exact text in quotes inside prompts
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.