ImageZT

Free placeholder image service for developers. Generate custom images with specific dimensions, colors, and text in seconds.

Try It Now

Generate placeholder images with custom dimensions, colors, and text:

Example placeholder image showing ImageZT logo
GET /imagezt/800x600/ffffff/000000?text=ImageZT

Features

Simple API

Generate placeholder images with a simple URL structure. No authentication required, just construct your URL and get instant results.

Customizable

Choose dimensions, background and foreground colors, text, font size, and text wrapping options to create the perfect placeholder for your needs.

High Performance

Optimized for speed with caching headers and efficient image generation. Perfect for development and production environments.

Interactive Image Generator

Create custom placeholder images with our interactive generator. Adjust parameters and see results in real-time.

Your generated image will appear here
Configure your image and click "Generate Image" to see the URL

API Documentation

Overview

ImageZT provides a simple RESTful API for generating placeholder images on-demand. All images are generated dynamically based on URL parameters and returned as image files with appropriate caching headers.

The service supports both standalone deployment and serverless functions (Netlify), with consistent API behavior across platforms.

Base URL

https://imagezt.davidgoweb.com

All API endpoints are relative to this base URL.

Generate Image

GET /imagezt/:dims/:bgColor/:fgColor

Path Parameters

dims: Image dimensions in format WxH (e.g., 800x600)
Requirements: Width and height must be positive integers between 1 and 5000 pixels
bgColor: Background color as 6-digit hex (without #)
Example: ffffff for white, 000000 for black
fgColor: Foreground/text color as 6-digit hex (without #)
Example: 000000 for black, ff0000 for red

Query Parameters

text: Custom text to display on the image
Default: The dimensions string (e.g., "800x600")
Note: Text is URL-encoded, so spaces become %20 or +
fontSize: Font size in pixels
Range: 8-128 pixels
Default: Auto-sized based on image dimensions
Available sizes: 8, 16, 32, 64, 128 (nearest size is selected)
textWrap: Enable text wrapping
Values: true or false
Default: false
Note: When enabled, long text will wrap to multiple lines
textWrapWidth: Text wrap width percentage
Range: 50-95
Default: 80
Note: Controls the maximum width of wrapped text as a percentage of image width

Response

Content-Type: image/png (default), image/jpeg, or image/bmp based on configuration

Cache-Control: public, max-age=31536000, immutable (configurable)

ETag: Unique identifier for the generated image (when enabled)

Body: Binary image data

Service Information

GET /imagezt/

Response

Content-Type: application/json

{ "service": "ImageZT", "version": "1.0.0", "description": "Placeholder image generation service", "usage": "/:width/:height/:bgColor/:fgColor?text=custom", "example": "/800x600/ffffff/000000?text=Hello" }

Health Check

GET /imagezt/health

Response

Content-Type: application/json

{ "status": "ok", "timestamp": "2024-01-01T00:00:00.000Z", "environment": "production" }

Note: In standalone deployment, additional fields like uptime are included

Error Responses

The API returns standard HTTP status codes with descriptive error messages:

400 Bad Request: Invalid parameters
Examples: Invalid dimensions, colors, font size, or text wrap width
500 Internal Server Error: Image generation failed
Note: Detailed error messages are available in verbose mode

Example Error Response

HTTP/1.1 400 Bad Request Content-Type: text/plain Invalid dimensions format. Use WxH with positive numbers, e.g., 800x600

Performance Features

Caching: In-memory caching of generated images and fonts
Cache Size: 100 items (configurable)
Cache Key: Based on all parameters including text and formatting options
HTTP Caching: Optimized cache headers for browser and CDN caching
Cache-Control: public, max-age=31536000, immutable
ETag: Automatic ETag generation for conditional requests
Rate Limiting: Configurable rate limiting to prevent abuse
Default: 100 requests per 15 minutes per IP
Image Optimization: Configurable output formats and quality settings
Formats: PNG, JPEG, BMP
JPEG Quality: 90% (configurable)
PNG Compression: Balanced for speed and size

Try It Yourself

Click on any example below to see different placeholder images:

Common Use Cases

Website Hero Images

GET /imagezt/1200x600/3498db/ffffff?text=Hero%20Image&fontSize=48

Perfect for hero sections and headers

Card Thumbnails

GET /imagezt/300x200/e67e22/ffffff?text=Card%20Thumbnail

Standard card image dimensions

Profile Avatars

GET /imagezt/150x150/9b59b6/ffffff?text=Avatar&fontSize=32

Square profile placeholders

Blog Post Banners

GET /imagezt/800x400/2c3e50/ecf0f1?text=Blog%20Post%20Title&fontSize=36&textWrap=true&textWrapWidth=90

Banner images with wrapped text

Product Placeholders

GET /imagezt/400x400/f39c12/ffffff?text=Product%20Image&fontSize=28

E-commerce product image placeholders

Loading States

GET /imagezt/64x64/bdc3c7/7f8c8d?text=...&fontSize=24

Small loading indicators

Quick Reference

URL Structure

https://imagezt.davidgoweb.com/imagezt/{width}x{height}/{bgColor}/{fgColor}?text={text}&fontSize={size}&textWrap={bool}&textWrapWidth={percent}

Color Codes

White: ffffff
Black: 000000
Gray: 808080
Red: ff0000
Green: 00ff00
Blue: 0000ff
Yellow: ffff00
Cyan: 00ffff
Magenta: ff00ff

Tip: Use any 6-digit hex color code for custom colors

Common Dimensions

Square: 100x100, 200x200, 400x400, 500x500
Rectangle: 400x300, 800x600, 1200x900
Widescreen: 1280x720, 1920x1080
Portrait: 300x400, 600x800
Banner: 728x90, 468x60
Mobile: 320x480, 375x667, 414x736

Integration Examples

HTML

Placeholder

CSS Background

background-image: url('https://imagezt.davidgoweb.com/imagezt/1200x600/e74c3c/ffffff?text=Background');

JavaScript

const imageUrl = 'https://imagezt.davidgoweb.com/imagezt/300x200/2ecc71/ffffff?text=Dynamic'; document.getElementById('myImage').src = imageUrl;

React Component

function PlaceholderImage({ width, height, text }) { const baseUrl = 'https://imagezt.davidgoweb.com/imagezt'; const url = `${baseUrl}/${width}x${height}/cccccc/333333?text=${encodeURIComponent(text)}`; return {text} }