imagegen

Generate and edit images via the OpenAI Image API using a bundled CLI.

1|Updated May 6, 2026
One-click install
npx skills add https://github.com/surfingalien/FinSurfing --skill imagegen-surfingalien
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: imagegen
Source: https://github.com/surfingalien/FinSurfing/tree/main/.claude/skills/imagegen
Command: npx skills add https://github.com/surfingalien/FinSurfing --skill imagegen-surfingalien

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires openai, pillow, and includes scripts (resource) and references (resource) components.

What problem does it solve? Creating website assets, product mockups, UI mockups, or edited images requires design tools and manual iteration; this Skill automates image generation and editing through the OpenAI Image API with structured prompt augmentation and reproducible CLI runs. ## Core Features & Use Cases - Image Generation: Create new images from prompts with control over size, quality, background transparency, and output format using the gpt-image-1.5 model. - Image Editing: Perform inpainting, background replacement, object removal, text localization, and compositing with masks and input fidelity controls. - Batch Processing: Run many prompts concurrently from a JSONL file with retries, rate-limit handling, and optional downscaled web-ready copies. - Use Case: A developer building a landing page asks for a hero image with negative space for a headline; the Skill classifies the request, augments the prompt into a structured spec, runs the CLI, and saves the final PNG. ## Quick Start Ask the assistant to generate a hero image for your landing page using the imagegen skill, ensuring OPENAI_API_KEY is set in your environment first.

Frequently Asked Questions about imagegen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate images with the OpenAI Image API from the command line?

Run the bundled CLI with python scripts/image_gen.py generate --prompt "your prompt" --size 1024x1024. Set OPENAI_API_KEY first, and use --dry-run to preview the request payload without making an API call.

How do I edit an existing image or replace its background?

Use the edit subcommand with --image pointing to your input file and an optional PNG --mask for inpainting. State invariants in the prompt, such as "change only the background; keep the subject unchanged", and consider --input-fidelity high for strict edits.

Can I generate many images in one batch run?

Yes, write one JSON job per line in a JSONL file and run generate-batch --input file.jsonl --out-dir out --concurrency 5. The CLI retries transient errors and supports per-job overrides for size, quality, and output format.

Does the OpenAI Image API support transparent backgrounds?

Yes, set --background transparent with --output-format png or webp. Transparent output is not compatible with JPEG, and the CLI validates this combination before making the API call.

Why does image generation fail with an API key error?

The CLI requires the OPENAI_API_KEY environment variable for live calls and exits if it is missing. Create a key at platform.openai.com/api-keys, export it in your shell, and confirm it is set before rerunning.

What are the size and quality limits for gpt-image-1.5?

Supported sizes are 1024x1024, 1536x1024, 1024x1536, or auto, with quality levels low, medium, high, or auto. Input images and masks must be under 50MB, and n can range from 1 to 10 images per request.