Image placeholder

This API generates a placeholder image with specified width, height, and background color
2ms

About

The API generates a placeholder image based on the provided parameters for width, height, and background color. The color is specified in HEX format and converted to RGB for image creation. The generated image is in PNG format and returned directly in the HTTP response
by GLOBUS.studio

Endpoint

				
					async function getPlaceholderImage(width, height, color) {
    const response = await fetch(`https://api.globus.studio/v2/ph_image?width=${width}&height=${height}&color=${encodeURIComponent(color)}`);
    const blob = await response.blob();
    const img = document.createElement('img');
    img.src = URL.createObjectURL(blob);
    document.body.appendChild(img);
}

getPlaceholderImage(200, 150, '#FF5733');

-or-

<img src="https://api.globus.studio/v2/ph_image?width=200&amp;height=150&amp;color=#FF5733">