When creating a website or wireframe, you might not have all the images
at first, but you know the sizes ..!
DummyJSON Image provides placeholder images on the fly via URL.
Samples:
URL = https://dummyjson.com/image
You just need to provide image size after URL. Only image size is
necessary. Options are available to change text color or background
color, you can pass second parameter after size which will be the
background color, it must be hexadecimal, third parameter is the text
color. The text can be passed with the
text query param. Here are some examples you can look
at:
<img src="https://dummyjson.com/image/300">
<img src="https://dummyjson.com/image/250x100">
<img src="https://dummyjson.com/image/250x100/ff0000">
<img src="https://dummyjson.com/image/350x200/ff0000/000">
<img src="https://dummyjson.com/image/350x200/?text=Hello+Peter">
<img src="https://dummyjson.com/image/350x200/282828/eae0d0/?text=Hello+Peter&fontFamily=cookie">
Specify one dimension to get a square image URL/WIDTH https://jsonexamples.com/image/150
Specify width and height URL/WIDTHxHEIGHT https://dummyjson.com/image/400x200
Specify background color URL/SIZE/BACKGROUND https://dummyjson.com/image/400x200/282828
Specify text color URL/SIZE/BACKGROUND/COLOR https://dummyjson.com/image/400x200/282828/ff0000
Specify image format URL/?type=TYPE Supported Formats: [png, jpg, webp] https://dummyjson.com/image/400x200/282828?type=jpg
Specify custom text URL/?text=TEXT https://dummyjson.com/image/400x200/282828?text=Hello+Peter!
Specify font family URL/?text=TEXT&fontFamily=cookie See available fonts https://dummyjson.com/image/400x200/282828?text=Hello+Peter!&fontFamily=cookie
Specify font size URL/?text=TEXT&fontSize=FONT_SIZE https://dummyjson.com/image/400x200?text=Hello+Peter!&fontSize=16