Skip to main content

Overview

The ThumbnailDesignerAgent generates eye-catching YouTube thumbnails optimized for high click-through rates. It uses Sharp for image processing and creates thumbnails with strategic text overlays, color schemes, and visual elements.

Constructor

Database
required
Database instance for storing thumbnail data
Credentials
required
Credentials manager for external services

Properties

string
Path to thumbnail template assets directory
Logger
Logger instance for tracking thumbnail generation

Methods

initialize()

Initializes the agent and creates necessary directories.
Promise<boolean>
Returns true when initialization is complete

generateThumbnail(script)

Generates a complete, optimized thumbnail for a video script.
Object
required
Video script object
string
required
Video title
Object
Content strategy with contentType
Promise<Object>
Thumbnail data object
string
Path to optimized thumbnail file (JPEG, under 2MB)
Object
Design concept with style, colors, elements
string
AI generation prompt used
Object
Width and height (1280x720)
number
File size in bytes

generateConcept(script)

Generates thumbnail design concept based on content type.
Object
required
Video script object
Promise<Object>
Design concept object
string
Shortened title for thumbnail (max 5 words)
string
Visual style: clean, informative, numbered, comparative, or dramatic
string
Main text overlay (impact word or number)
string
Supporting text overlay
Array<string>
Visual elements to include
Object
Color scheme with primary, secondary, and accent colors
string
Emotional tone: helpful, curious, exciting, analytical, or intriguing
string
Layout composition style
Object
Visual effects to apply (blur, vignette, glow, shadow, border)

Thumbnail Concepts by Content Type

createThumbnail(concept)

Creates base thumbnail image with gradient background.
Object
required
Design concept from generateConcept()
Promise<string>
Path to base thumbnail PNG file

addTextOverlay(imagePath, concept)

Adds text overlay to thumbnail image.
string
required
Path to base thumbnail image
Object
required
Design concept with primaryText and secondaryText
Promise<string>
Path to thumbnail with text overlay

optimizeForYouTube(imagePath)

Optimizes thumbnail for YouTube specifications.
string
required
Path to thumbnail image
Promise<string>
Path to optimized JPEG file
string
JPEG with progressive encoding
number
90% quality, reduced to 80% if file exceeds 2MB
Object
1280x720 (YouTube recommended size)
number
2MB (YouTube limit)

generateABVariants(concept)

Generates multiple thumbnail variants for A/B testing.
Object
required
Base design concept
Promise<Array<string>>
Array of paths to thumbnail variants

extractPrimaryText(title)

Extracts most impactful text from title.
string
required
Video title
string
Primary text for thumbnail (uppercase)

formatThumbnailTitle(title)

Shortens title for thumbnail display.
string
required
Full video title
string
Shortened title (max 5 words)

selectComposition()

Randomly selects a composition style.
string
Composition style: rule-of-thirds, centered, diagonal, golden-ratio, or symmetrical

selectEffects()

Randomly selects visual effects to apply.
Object
Effects configuration object

Usage Example

YouTube Thumbnail Requirements

1280x720 pixels (16:9 aspect ratio) - YouTube’s recommended size
Under 2MB - automatically enforced by optimizeForYouTube()
JPEG recommended - PNG also supported but results in larger files
90% quality for best balance, reduced to 80% if file exceeds limit

Best Practices

The agent automatically adds text shadows for readability. Primary text is large (120px) and bold.
Use generateABVariants() to create multiple thumbnails and test which performs best with your audience.
Each content type has optimized colors and style. Tutorial thumbnails use educational blue/green, while list videos use attention-grabbing red/yellow.
Primary text is limited to one impactful word or number. Secondary text adds context but stays concise.
Track click-through rates and adjust concept generation based on what works for your audience.