0Pricing
AI Prompt Engineering · Lesson

Anatomy of an Image Generation Prompt

Subject, style, medium, lighting, color palette, and composition elements.

Anatomy of an Image Generation Prompt is a free AI Prompt Engineering lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AI Prompt Engineering learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Image Prompt as a Recipe

An image generation prompt is a recipe for a visual. Like cooking, the order and balance of ingredients matters. Missing elements produce generic results; wrong elements produce surprising failures. Mastering the anatomy of a prompt gives you predictable creative control.

The Six Core Components

Every strong image prompt contains six components: Subject (what), Style (how it looks), Medium (art form), Lighting (illumination), Color Palette (tone), and Composition (framing). Omitting any component leaves the model to guess — usually with generic defaults.

# Anatomy of an image prompt
prompt_components = {
    'subject':    'A lone lighthouse on a rocky coastline',
    'style':      'dramatic, moody, cinematic',
    'medium':     'oil painting',
    'lighting':   'stormy overcast sky, waves crashing, dramatic side-lighting',
    'color_palette': 'desaturated blues and grays with warm amber light from the lighthouse',
    'composition': 'wide establishing shot, rule of thirds, lighthouse at left third'
}

# Assemble into a prompt string
full_prompt = (
    '{subject}, {style}, {medium}, {lighting}, '
    '{color_palette}, {composition}'
).format(**prompt_components)

print(full_prompt)
# A lone lighthouse on a rocky coastline, dramatic, moody, cinematic,
# oil painting, stormy overcast sky, waves crashing, dramatic side-lighting,
# desaturated blues and grays with warm amber light from the lighthouse,
# wide establishing shot, rule of thirds, lighthouse at left third

Subject: The What

The subject is the most important component — it tells the model what to depict. Be as specific as possible: include species, age, emotion, action, environment, and spatial relationships.

# Subject specificity comparison

# Weak subject:
weak = 'a person in a city'

# Strong subject (same concept, much more specific):
strong = (
    'a young woman in her 30s, wearing a vintage 1960s trench coat, '
    'standing at a rain-soaked street corner in Tokyo at night, '
    'looking up at neon signs reflected in the puddles, '
    'holding a dripping umbrella, expression of quiet wonder'
)

# The strong subject answers:
# WHO: young woman, 30s
# WHAT WEARING: 1960s trench coat
# WHERE: Tokyo street corner
# WHEN: night, raining
# WHAT DOING: standing, looking up
# EXPRESSION: quiet wonder
# KEY DETAIL: neon reflections in puddles, dripping umbrella

print('Weak:', weak)
print('Strong:', strong[:100], '...')

Style: The How

Style descriptors tell the model the visual language and aesthetic register of the image. They can reference art movements, specific artists, visual media, or abstract aesthetic qualities.

style_examples = [
    # Art movements
    'impressionist', 'art nouveau', 'bauhaus', 'minimalist', 'surrealist',

    # Artist references
    'in the style of Monet', 'reminiscent of Hopper', 'inspired by Klimt',

    # Visual media
    'film noir', 'vaporwave aesthetic', 'cottagecore', 'brutalist',

    # Quality descriptors
    'highly detailed', 'cinematic', 'editorial photography style',
    'concept art', 'matte painting', 'character design sheet',

    # Mood
    'ethereal', 'gritty', 'whimsical', 'melancholic', 'vibrant', 'serene'
]

# Combining styles creates unique aesthetics
combined_style = 'cyberpunk aesthetic meets art nouveau, highly detailed, dark ethereal'
print('Combined style:', combined_style)

# Warning: too many style directives create incoherence
too_many = 'impressionist, minimalist, surrealist, photorealistic, anime, baroque'
print('Too many (incoherent):', too_many)

Medium: The Art Form

The medium defines the physical or digital art form. It fundamentally changes the texture, line quality, and tonality of the generated image. Common mediums and what they produce:

medium_guide = {
    # Traditional media
    'oil painting': 'Rich, textured, classic look with visible brushwork',
    'watercolor': 'Soft edges, translucent washes, paper texture visible',
    'pencil sketch': 'Line art, cross-hatching, grayscale, raw feel',
    'charcoal drawing': 'Soft, smudgy, high contrast, dramatic shadows',
    'ink illustration': 'Bold lines, flat colors or crosshatching',

    # Photography
    'photorealistic': 'Looks like a real photograph',
    'film photography': 'Grain, color shift, analog feel',
    'macro photography': 'Extreme close-up, shallow depth of field',
    'long exposure photography': 'Motion blur, light trails',

    # Digital / 3D
    '3D render': 'CGI quality, precise geometry',
    'octane render': 'Photorealistic 3D with ray-tracing quality',
    'Blender 3D': 'CGI aesthetic, often used with subdivision modeling',
    'pixel art': 'Retro 8-bit or 16-bit style, visible pixels',
    'vector illustration': 'Clean, flat, scalable design style'
}

for medium, description in list(medium_guide.items())[:5]:
    print(f'{medium}: {description}')

Lighting: Shaping the Mood

Lighting is the single most powerful mood-setter in visual art. The same subject looks completely different under golden hour sunlight vs. harsh interrogation room lighting. Master the lighting vocabulary.

lighting_vocabulary = {
    # Time of day
    'golden hour': 'Warm orange-yellow, long shadows, magic hour feel',
    'blue hour': 'Cool blue twilight, soft diffused light',
    'harsh midday': 'Hard shadows, washed-out, unflattering (usually avoided)',
    'overcast': 'Soft even light, no shadows, good for portraits',

    # Studio / artificial
    'studio lighting': 'Controlled, professional, even illumination',
    'Rembrandt lighting': 'Triangle of light on cheek, dramatic portrait technique',
    'neon lighting': 'Colorful, urban, cyberpunk feel',
    'candlelight': 'Warm, flickering, intimate',

    # Dramatic
    'chiaroscuro': 'Extreme light/dark contrast, Baroque dramatic style',
    'volumetric lighting': 'God rays, light shafts through fog or dust',
    'backlit / rim light': 'Subject outlined by light from behind, halo effect',
    'bioluminescent': 'Glowing from within, alien or underwater feel'
}

example = 'volumetric lighting, golden hour, warm glow filtering through forest canopy'
print('Lighting example:', example)

Color Palette: The Emotional Register

Color palette controls the emotional register and visual coherence of an image. Specify palettes descriptively or by referencing art movements, films, or nature.

color_palette_examples = [
    # Temperature-based
    'warm earth tones: rust, ochre, sienna, cream',
    'cool blues and silvers, icy palette',
    'neutral gray monochrome with single red accent',

    # Mood-based
    'muted, desaturated, melancholic color grading',
    'vibrant saturated colors, tropical energy',
    'pastel soft colors, dreamlike softness',

    # Reference-based
    'Wes Anderson color palette: pastel pinks and greens',
    'film noir: high contrast black and white with amber shadows',
    'synthwave neon: pink, purple, cyan on dark backgrounds',

    # Nature-based
    'autumn forest: burnt orange, golden yellow, deep brown',
    'arctic palette: white, pale blue, grey with deep navy accents',
]

# Color palettes can clash with lighting — ensure they work together
clash = 'vibrant tropical colors + film noir lighting'  # incoherent
harmony = 'warm amber and ochre tones + golden hour lighting'  # coherent

print('Harmonious combo:', harmony)

Composition: Framing and Focus

Composition directives tell the model how to frame the shot — what to include, what to emphasize, and where to place elements. Borrowing from photography and cinematography vocabulary works well.

composition_vocabulary = {
    # Camera distance
    'extreme close-up': 'fills frame with a single detail (eye, hand, texture)',
    'close-up': 'face or object fills most of frame',
    'medium shot': 'waist to head, character-focused',
    'wide shot': 'full body in environment context',
    'establishing shot': 'landscape/environment, tiny or no character',
    'aerial / bird\'s eye view': 'looking straight down',
    'worm\'s eye view': 'looking straight up from below',

    # Composition rules
    'rule of thirds': 'subject at intersection of 1/3 lines',
    'centered composition': 'symmetrical, formal, powerful',
    'leading lines': 'lines guide eye toward subject',
    'negative space': 'large empty area emphasizes subject',
    'frame within frame': 'archway, window, or shape frames subject',

    # Depth
    'shallow depth of field': 'sharp subject, blurred background (bokeh)',
    'deep focus': 'everything in sharp focus front to back'
}

print('Composition example: close-up portrait, rule of thirds, shallow depth of field, bokeh background')

Full Prompt Assembly

Assembling all six components in a logical order produces consistently high-quality image prompts. A good ordering: Subject → Medium → Style → Lighting → Color Palette → Composition.

def build_image_prompt(
    subject, medium, style, lighting, color_palette, composition,
    quality_boost='highly detailed, 8K resolution'
):
    parts = [
        subject,
        medium,
        style,
        lighting,
        color_palette,
        composition,
        quality_boost
    ]
    # Filter out None values and join
    return ', '.join(p for p in parts if p)

# Example: Portrait
portrait = build_image_prompt(
    subject='elderly Japanese fisherman mending nets at sunrise, weathered hands, peaceful expression',
    medium='oil painting',
    style='impressionist, highly detailed, classical technique',
    lighting='golden hour sunrise, warm light from the left, soft shadows',
    color_palette='warm ochres, golds, deep navy sea in background',
    composition='medium shot, rule of thirds, subject right third, ocean left'
)
print(portrait)

Prompting for Consistency Across Images

When generating a series of images (character sheets, storyboards), maintain consistency by using a base prompt template with variable substitutions for elements that change across images.

BASE_CHARACTER_TEMPLATE = (
    '{character_description}, '
    '{action_description}, '
    'oil painting, concept art style, '
    'dramatic studio lighting, '
    'muted jewel tones with gold accents, '
    'close-up portrait, centered composition, '
    'highly detailed, cinematic'
)

character = (
    'a tall warrior woman with dark braided hair, emerald eyes, '
    'wearing ornate silver plate armor with dragon motifs'
)

action_variants = [
    'standing at attention, stoic expression, arms crossed',
    'battle-ready, sword raised, fierce expression, mid-action',
    'resting against a stone wall, exhausted but resolute, soft smile',
    'close-up portrait, neutral expression, slight three-quarter view'
]

for action in action_variants:
    prompt = BASE_CHARACTER_TEMPLATE.format(
        character_description=character,
        action_description=action
    )
    print(f'Generating: {action[:40]}...')
    # call image API with prompt

Quality Tokens

Most image models respond to quality tokens — terms that signal the desired output fidelity. Use these strategically to boost detail level without changing the subject or style.

quality_tokens = {
    'high_detail': [
        'highly detailed', 'intricate detail', 'ultra-detailed',
        '8K resolution', '4K wallpaper quality'
    ],
    'photorealism': [
        'photorealistic', 'hyperrealistic', 'photographed by',
        'DSLR photo', 'shot on 35mm film'
    ],
    'professional_quality': [
        'award-winning', 'professional photography', 'editorial quality',
        'museum quality', 'masterpiece'
    ],
    'rendering_quality': [
        'octane render', 'unreal engine 5', 'ray tracing',
        'subsurface scattering', 'global illumination'
    ]
}

# Best practice: add 2-3 quality tokens at the end of the prompt
quality_suffix = 'highly detailed, cinematic, 8K resolution'
print('Add to end of any prompt:', quality_suffix)

# Warning: do not overload with quality tokens — they dilute each other
too_many_quality = 'masterpiece, best quality, ultra-detailed, perfect, amazing, award-winning'
print('Over-specified (less effective):', too_many_quality[:60])

Quick Check

Which component of an image generation prompt most directly controls the emotional mood of the image?

Image Prompt Anatomy Summary

A well-constructed image prompt has six components working in harmony:

  • Subject: WHO and WHAT — the most important component; be highly specific
  • Style: aesthetic register, art movement, or artist reference
  • Medium: art form (oil painting, photorealistic, 3D render, pixel art)
  • Lighting: illumination that shapes atmosphere (golden hour, chiaroscuro, neon)
  • Color Palette: emotional temperature (warm earth tones, cool desaturated, neon)
  • Composition: framing (close-up, rule of thirds, establishing shot)

Add 2-3 quality tokens at the end. Use templates for consistent multi-image series.

Frequently asked questions

Is the “Anatomy of an Image Generation Prompt” lesson free?

Yes — the full text of “Anatomy of an Image Generation Prompt” is free to read here on the web, and the AI Prompt Engineering course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AI Prompt Engineering course, upgrade to CoddyKit PRO.

What will I learn in “Anatomy of an Image Generation Prompt”?

Subject, style, medium, lighting, color palette, and composition elements. You practise AI Prompt Engineering with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start AI Prompt Engineering?

No prior experience is required. AI Prompt Engineering on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Anatomy of an Image Generation Prompt” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this AI Prompt Engineering lesson?

Yes. Every AI Prompt Engineering lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Anatomy of an Image Generation Prompt
  2. Style and Artistic Medium Specification
  3. Negative Prompts and Exclusions
  4. Iterative Image Prompt Refinement
← Back to AI Prompt Engineering