agentsclimarketplace

Gemini image gen

Skill lamtuanvu/agentskills/skills/gemini-image-gen

Generates high-quality images using Google's Gemini API. Supports SVG vector graphics (icons, logos, illustrations, UI elements) via text models and PNG raster images via image generation models. This skill should be used when generating visual assets, creating vector resources for projects, producing icons or logos, or creating image content with AI.From its SKILL.md

Install
npx -y skills add lamtuanvu/agentskills --skill gemini-image-gen

Assembled 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.

SKILL.md

5.6 KB, as published. Nobody here has run it

Gemini Image Generation

Generate SVG vector graphics and PNG raster images using Google's Gemini API.

Prerequisites

  1. Set GEMINI_API_KEY environment variable (get a key at https://aistudio.google.com/apikey)
  2. Install dependencies: bash scripts/ensure_deps.sh

Full setup details in references/api_reference.md.

Decision Map

NeedFlowScript
Scalable vector graphic (icon, logo, diagram, UI element)SVGgenerate_svg.py
Photo-realistic or complex raster imagePNGgenerate_image.py
Edit/refine an existing imagePNG with --referencegenerate_image.py
Multiple variantsRun script multiple times with prompt variationsEither
UnsureDefault to SVG for project resourcesgenerate_svg.py

SVG Generation (Primary)

Use Gemini text models to generate SVG XML code directly. Best for project assets.

Basic

python3 scripts/generate_svg.py "a minimalist settings gear icon, flat style" \
  -o assets/icons/settings.svg

With Style and Color Options

python3 scripts/generate_svg.py "a cloud upload icon" \
  -o assets/icons/upload.svg \
  --style line-art \
  --colors "monochrome #333333" \
  --viewbox "0 0 24 24"

Options

FlagDefaultValues
--modelgemini-2.5-flashAny Gemini text model
--viewbox0 0 100 100Any valid SVG viewBox
--colorsNone"monochrome", "brand #hex", "vibrant", "pastel"
--styleNoneflat, line-art, gradient, isometric

Using Prompt Templates

Refer to assets/svg_prompt_templates.md for categorized prompt skeletons. Copy a template, fill in the placeholders, and pass as the prompt argument. Categories: icons, logos, illustrations, UI elements, diagrams, badges.

PNG Generation

Use Gemini image models for raster output when vector is not suitable.

Basic

python3 scripts/generate_image.py "a mountain landscape at golden hour" \
  -o assets/images/hero.png

With Full Options

python3 scripts/generate_image.py "product mockup of a phone showing the app dashboard" \
  -o assets/images/mockup.png \
  --model gemini-3-pro-image-preview \
  --aspect-ratio 16:9 \
  --size 2K

With Reference Image

python3 scripts/generate_image.py "same composition but with a dark theme" \
  -o assets/images/dark-mockup.png \
  --reference assets/images/mockup.png

Options

FlagDefaultValues
--modelgemini-3-pro-image-previewgemini-2.5-flash-image, gemini-3-pro-image-preview, gemini-3.1-flash-image-preview
--aspect-ratio1:11:1, 2:3, 3:2, 3:4, 4:3, 16:9, 9:16, 21:9, etc.
--size2K1K, 2K, 4K
--referenceNonePath to a reference image

Model Selection

ModelTypeBest ForSpeed
gemini-2.5-flashText/SVGVector graphics, SVG codeFast
gemini-2.5-flash-imageImage/PNGQuick raster imagesFast
gemini-3-pro-image-previewImage/PNGHigh-quality raster, pro assetsSlower
gemini-3.1-flash-image-previewImage/PNGBatch/high-volume generationFast

Prompt Tips

  • Be specific about style, colors, and composition rather than vague
  • For icons: specify viewBox matching intended use (24x24 for toolbar, 512x512 for app)
  • For SVG: request "no text elements" unless text is needed, to avoid font dependencies
  • For PNG: use photography terms (lighting, angle, depth of field) for realistic results
  • Prefix with "flat style" or "line-art" to control visual approach

Advanced prompt strategies in references/svg_prompting_guide.md.

Guardrails

  • For SVG output: verify the file contains valid <svg> tags before considering complete
  • For PNG output: confirm file was written and is non-zero bytes
  • API rate limits: ~15 RPM on free tier. Space rapid successive calls
  • Content policy: Gemini rejects certain prompts. If blocked, rephrase without restricted terms
  • Save outputs to the project directory, not temporary locations

Common Mistakes

MistakeFix
Using an image model for SVGImage models output PNG only. Use generate_svg.py with a text model
No API key setRun bash scripts/ensure_deps.sh to check, or set GEMINI_API_KEY
Vague SVG promptsAdd style, color, viewBox, and element constraints. Use a template
SVG has <text> with missing fontsAdd "convert text to paths" or "no text elements" to prompt

References

Consult when blocked or need detailed information:

Keep looking

Skills are one crate of 607,533. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.