threejs-image-generator

Generate and edit 2D game image assets for Three.js projects using the Gemini image API.

1|Updated Aug 20, 2023
One-click install
npx skills add https://github.com/imanlangaran/mini-projects --skill threejs-image-generator-imanlangaran
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-image-generator
Source: https://github.com/imanlangaran/mini-projects/tree/main/building-sell/.claude/skills/threejs-image-generator
Command: npx skills add https://github.com/imanlangaran/mini-projects --skill threejs-image-generator-imanlangaran

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires google-genai, pillow, and includes scripts (resource) components.

What problem does it solve? Creating concept art, textures, UI art, and image-to-3D reference images for Three.js games normally requires manual design work or external tools; this Skill automates that asset production through Google's Gemini image API directly from the project workflow. ## Core Features & Use Cases - Image Generation: Create concept sheets, texture references, sky/background plates, decals, logos, icons, and GUI art at 1K, 2K, or 4K resolution. - Image Editing: Modify an existing image via --input-image, with automatic resolution detection based on the input dimensions. - Image-to-3D Pipeline: Produce clean reference images that feed threejs-3d-generator for image-to-3D model creation. - Use Case: While building a Three.js racing game, generate a battle-worn red livery variant of a ship concept, save it under assets/concepts/, then hand the path to the 3D generator skill. ## Quick Start Ask the AI to generate a 2K concept image of a game asset with the prompt describing the subject and save it into the project's assets/concepts folder using this skill.

Frequently Asked Questions about threejs-image-generator

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

FAQPage Schema
How do I generate game textures with the Gemini image API?

Run the generate_image.py script with a prompt describing the surface, a filename, and a resolution of 1K, 2K, or 4K. The script calls the Gemini image model and saves the result as PNG or JPEG in your project directory.

How do I edit an existing image with Gemini in Python?

Pass the image path with --input-image along with an editing prompt. The script loads the image with Pillow, auto-detects an appropriate resolution from its dimensions, and sends both image and prompt to the Gemini model.

What API key does Gemini image generation require?

The script reads the key from the --api-key argument or the GEMINI_API_KEY environment variable. Run the probe command to print GEMINI_API_KEY=SET or MISSING before assuming the credential is unavailable.

Does the script preserve transparency in generated PNGs?

Yes, PNG output preserves the alpha channel as RGBA, which matters for logos, icons, UI elements, and decals. JPEG output flattens transparency onto a white background since JPEG has no alpha support.

Why does image generation fail with a no API key error?

The error occurs when neither --api-key nor GEMINI_API_KEY is set in the process environment. Keys defined only in a shell profile may be absent, so source your shell profile or pass the key explicitly.