Clean, descriptive, and developer-friendly image generation API
Generate placeholder images with our clean, descriptive API. All parameters are clearly labeled and optional.
GET /generate
width
- Image width in pixelsheight
- Image height in pixelsbg
- Background color (hex without #)color
- Text color (hex without #)text
- Custom text to displayformat
- Output format (png, jpg, webp)transparent
- Transparent background (true/false)
/generate?width=800&height=600
/generate?width=800&height=600&bg=4A90E2&color=FFFFFF
/generate?width=800&height=600&text=Hello+World
/generate?width=800&height=600&transparent=true&color=333333
/generate?width=800&height=600&format=jpg
/generate?width=800&height=600&format=webp
Parameter | Description | Default | Example |
---|---|---|---|
font |
Font family | Arial | font=Arial |
font_size |
Font size in pixels | Auto-calculated | font_size=24 |
align |
Text alignment (left, center, right) | center | align=center |
valign |
Vertical alignment (top, middle, bottom) | middle | valign=middle |
pattern |
Background pattern | solid | pattern=stripes |
border |
Border width in pixels | None | border=2 |
border_color |
Border color (hex without #) | 000000 | border_color=FF0000 |
radius |
Corner radius in pixels | None | radius=10 |
shadow |
Shadow effect | None | shadow=5,5,10,000000 |
watermark |
Watermark text | None | watermark=Imgrly |
<img src="/generate?width=800&height=600&bg=4A90E2&color=FFFFFF&text=Hero+Image" alt="Hero">
.hero {
background-image: url('/generate?width=1920&height=1080&bg=4A90E2&color=FFFFFF');
}
const img = new Image();
img.src = `/generate?width=${width}&height=${height}&bg=${bgColor}&color=${textColor}`;
$url = "https://imgrly.com/generate?width=800&height=600&bg=4A90E2&color=FFFFFF";
$image = file_get_contents($url);
All responses include proper caching and content type headers for optimal performance.
Header | Value | Description |
---|---|---|
Content-Type |
image/png , image/jpeg , image/webp |
Based on format parameter |
Cache-Control |
public, max-age=31536000 |
Cache for 1 year |
Content-Length |
12345 |
Size of generated image |
Status Code | Error | Description |
---|---|---|
400 |
Missing required parameters | Width and height are required |
400 |
Invalid dimensions | Dimensions must be positive numbers |
400 |
Dimensions too large | Maximum allowed: 5000x5000 |
500 |
Image generation failed | Server error during image creation |
We maintain backward compatibility with the old URL format, but we recommend using the new clean API.
/placeholder/800x600/4A90E2/FFFFFF?text=Hello+World
/generate?width=800&height=600&bg=4A90E2&color=FFFFFF&text=Hello+World