API Documentation
Generate custom placeholder images with a simple URL-based API
Quick Start
The simplest way to generate an image:
https://imges.dev/800x600Or use shorthand for square images:
https://imges.dev/300800x600300URL Structure
https://imges.dev/[dimensions]/[bg-color]/[fg-color]?[params]For square images, use shorthand: [size] instead of [dimensions]
[dimensions]
requiredFormat: WIDTHxHEIGHT or SIZE (for square)
Examples: 800x600, 1920x1080, 300 (creates 300x300)
[bg-color]
optionalHex color code without # (default: cccccc)
Examples: 3b82f6, ff0000, random
[fg-color]
optionalText color hex code without # (default: 333333)
Examples: ffffff, 000000, random
Query Parameters
text
Custom text to display on the image. Supports emojis!
/800x600?text=Hello%20Worldsize
Font size in pixels (default: auto-calculated)
/800x600?text=Big%20Text&size=80weight
Font weight: normal, bold, or 100-900
/800x600?text=Bold&weight=boldstyle
Font style: normal or italic
/800x600?text=Italic&style=italicalign
Vertical alignment: top, center, bottom, or custom
/800x600?text=Top&align=topfont
Custom font from Google Fonts library. Choose from 20+ popular fonts including Inter, Roboto, Playfair Display, and more.
/800x600?text=Fancy%20Font&font=playfair-displayView all supported fonts
border
Border width in pixels
/800x600?border=10&borderColor=ff0000radius
Border radius in pixels for rounded corners
/800x600?text=Rounded&radius=30noise
Add noise/grain texture effect (0-100). Great for vintage or textured looks.
/800x600?text=Noisy&noise=50pattern
Add pattern overlay: dots, stripes, checkerboard, or grid (use with patternColor for custom colors)
/800x600?pattern=dots&patternColor=3b82f6format
Image format: png, jpeg, or webp (default: webp)
/800x600.png or /800x600?format=pngAdvanced Features
Gradients
Use two colors separated by a dash for linear gradients
/800x600/3b82f6-8b5cf6/ffffff?text=GradientRetina (@2x)
High-resolution images for retina displays
/800x600@2xGenerates an image at 2x the specified dimensions
Random Colors
Use "random" for background or foreground colors
/800x600/random/ffffffEach request generates a different random color
Emoji Support
Full color emoji support using Twemoji
/800x600?text=Hello%20👋%20World%20🌍Font Showcase
Preview of available custom fonts from Google Fonts
Sans-Serif
Serif
Monospace
Display
Example URLs
/1920x1080/3b82f6-8b5cf6/ffffff?text=Hero%20Image&size=100&weight=bold/400x300/random/ffffff?text=Card&border=5&borderColor=000000Error Handling
The API returns detailed JSON error responses when requests are invalid, helping you quickly identify and fix issues.
Error Response Format
All error responses include these fields:
{
"error": "Error title",
"message": "Detailed error message",
"received": "The value you provided",
"expected": "What we expected",
"suggestion": "How to fix it",
"docs": "https://imges.dev/docs",
"examples": [
"https://imges.dev/800x600",
"https://imges.dev/300"
]
}Common Error Examples
Invalid Dimension Format
GET /invalidReturns: "Invalid dimension format. Expected: WIDTHxHEIGHT or SIZE (e.g., 800x600 or 300)"
Dimensions Out of Range
GET /5000x5000Returns: "Dimensions exceed maximum allowed size. Max: 4000x4000"
Invalid Color Format
GET /800x600/invalidcolorReturns: "Invalid hex color format. Expected: 3 or 6 hexadecimal digits (e.g., 'fff' or '3b82f6')"
Unsupported Format
GET /800x600.gifReturns: "Unsupported image format. Supported: png, jpeg, webp"
Invalid Query Parameter
GET /800x600?border=abcReturns: "Invalid border value. Expected: Number between 0 and 100"
Tip: When integrating the API, check the HTTP status code.200 indicates success and returns an image.400 indicates a client error with a JSON error response.500 indicates a server error.
Limits & Best Practices
- • Maximum dimensions: 4000x4000 pixels
- • Minimum dimensions: 1x1 pixels
- • Maximum total pixels (after scale): 8,000,000
- • Practical square limits: ~2828x2828 at @1x, ~1414x1414 at @2x
- • Images are cached for optimal performance
- • WebP format recommended for best compression
- • URL-encode special characters in text