Generate and edit images using Google's Gemini API. Supports text-to-image, image editing, multi-turn refinement, and composition from multiple reference images. Use when creating images from prompts, editing existing images, generating logos, stickers, or product mockups.
/plugin marketplace add majesticlabs-dev/majestic-marketplace/plugin install majestic-creative@majestic-marketplaceThis skill is limited to using the following tools:
requirements.txtscripts/edit_image.pyscripts/generate_image.pyGenerate and edit images using Google's Gemini API. Requires GEMINI_API_KEY environment variable.
| Setting | Default | Options |
|---|---|---|
| Model | gemini-3-pro-image-preview | Use this for all generation |
| Resolution | 1K | 1K, 2K, 4K |
| Aspect Ratio | 1:1 | 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 |
bash {baseDir}/scripts/generate_image.py "A cat in space" output.jpg
bash {baseDir}/scripts/generate_image.py "Epic landscape" landscape.jpg --aspect 16:9 --size 2K
bash {baseDir}/scripts/generate_image.py "Logo for Acme Corp" logo.jpg --aspect 1:1
bash {baseDir}/scripts/edit_image.py input.jpg "Add a rainbow" output.jpg
bash {baseDir}/scripts/edit_image.py photo.jpg "Make it look like Van Gogh" artistic.jpg
import os
from google import genai
from google.genai import types
client = genai.Client(api_key=os.environ["GEMINI_API_KEY"])
response = client.models.generate_content(
model="gemini-3-pro-image-preview",
contents=["Your prompt here"],
config=types.GenerateContentConfig(
response_modalities=['TEXT', 'IMAGE'],
),
)
for part in response.parts:
if part.text:
print(part.text)
elif part.inline_data:
image = part.as_image()
image.save("output.jpg") # Always use .jpg!
response = client.models.generate_content(
model="gemini-3-pro-image-preview",
contents=[prompt],
config=types.GenerateContentConfig(
response_modalities=['TEXT', 'IMAGE'],
image_config=types.ImageConfig(
aspect_ratio="16:9",
image_size="2K"
),
)
)
from PIL import Image
img = Image.open("input.jpg")
response = client.models.generate_content(
model="gemini-3-pro-image-preview",
contents=["Add a sunset to this scene", img],
config=types.GenerateContentConfig(
response_modalities=['TEXT', 'IMAGE'],
),
)
chat = client.chats.create(
model="gemini-3-pro-image-preview",
config=types.GenerateContentConfig(response_modalities=['TEXT', 'IMAGE'])
)
response = chat.send_message("Create a logo for 'Acme Corp'")
# Save first image...
response = chat.send_message("Make the text bolder and add a blue gradient")
# Save refined image...
| Style | Prompt Pattern |
|---|---|
| Photorealistic | Include camera: lens, lighting, angle, mood |
| Stylized Art | Specify style explicitly: "kawaii-style", "cel-shading" |
| Text in Images | Be explicit: font style, placement, colors |
| Product Mockups | Describe lighting setup and surface |
# Photorealistic
"A photorealistic close-up portrait, 85mm lens, soft golden hour light, shallow depth of field"
# Stylized
"A kawaii-style sticker of a happy red panda, bold outlines, cel-shading, white background"
# Logo with text
"Create a logo with text 'Daily Grind' in clean sans-serif, black and white, coffee bean motif"
# Product mockup
"Studio-lit product photo on polished concrete, three-point softbox setup, 45-degree angle"
response = client.models.generate_content(
model="gemini-3-pro-image-preview",
contents=["Visualize today's weather in Tokyo as an infographic"],
config=types.GenerateContentConfig(
response_modalities=['TEXT', 'IMAGE'],
tools=[{"google_search": {}}]
)
)
response = client.models.generate_content(
model="gemini-3-pro-image-preview",
contents=[
"Create a group photo of these people in an office",
Image.open("person1.jpg"),
Image.open("person2.jpg"),
Image.open("person3.jpg"),
],
config=types.GenerateContentConfig(
response_modalities=['TEXT', 'IMAGE'],
),
)
Gemini returns JPEG by default. Always use .jpg extension.
# CORRECT
image.save("output.jpg")
# WRONG - causes "Image does not match media type" errors
image.save("output.png") # Creates JPEG with PNG extension!
from PIL import Image
for part in response.parts:
if part.inline_data:
img = part.as_image()
img.save("output.png", format="PNG") # Explicit conversion
file image.png
# If output shows "JPEG image data" - rename to .jpg!
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.