This script enables you to create placeholder images in a breeze.
Just link to the image.php
file via the HTML <img>
element. For example, <img src ="image.php?size=500x250&type=png&bg=f00&color=ffffff&text=Dummy" alt="Dummy Image">
would create a PNG image with red (#f00) background, white (#ffffff) text, the word “Dummy” written on it and a size of 500px width, 250px height.
This script handles the following parameters, where basically all of them are optional.
size
*(default: 640x480) — Examples:
500x250 (= 500px width, 250px height)
500 (= 500px square) *type
(default: png) — Examples:
png (= PNG image)
gif (= GIF image)
jpeg or jpg (= JPEG image)bg
(default: CC0099) — Examples:
f00 (= #FF0000 as background color)
FF0855 (= #FF0855 as background color)color
(default: FFFFFF) — Examples:
000 (= #000000 as font color)
FFFFFF (= #FFFFFF as font color)text
(default: {WidthOfTheImage}×{HightOfTheImage}) — Examples:
Lore Ipsum (= Image has Lore Ipsum written on it)
Please see the license file for more information.
Original idea by Russel Heimlich. When I first published this script, DummyImage.com was not Open Source, so I had to write a small script to replace the function on my own server.