How to quickly generate dummy images for your code?? an introduction to Placehold.it

Why placeholder images?


Mostly in Designing and Testing,you require a lot of images of different sizes and formats.You would probably search for such an image,download it,save it and use it wherever required.But what if you constantly require dummy images ,and that too of different sizes and formats.It is not at all wise to search for such images every time,moreover you waste a lot of time over it.

Dummy images to be used temporarily are technically termed as placeholder images.To quickly generate placeholder images,you can use a service called Placeholder.it,where you type the url and get your required image.Please read through to know how to use it and make your work easier.


To generate an image of a fixed size

Try out these urls for generating an image of a size that you require.

For an image of size 200*200,use

http://placehold.it/200

For an image of size 100*150,use

http://placehold.it/100x150

You can also us it in your code:

<img src="http://placehold.it/100x150">


To generate coloured images

The format is:

http://placehold.it/200/000000/ffffff

http://placehold.it/100x150/000000/ffffff

The hexcode of colours are used to represent them.The first color represents the background colour and the second one represents the text colour.In the url,as you can see,the colour is always given after the dimension.In this way,you can generate images of any dimension and any colour.

Some of the hexcodes of colours are given below:

ffffff-White

000000-Black

00ff00-Green

0000EE-Blue

380474-Violet

CD0000-Red

EE7600-Yellow

For more colours,refer the following url:

http://www.december.com/html/spec/colorhex.html


To generate images with text

The following url generates an image of size 200x200 with text "hello" in it.

http://placehold.it/200&text=hello

To insert spaces,use the '+' wherever you need space.For example,

http://placehold.it/200&text=hello+dear

Paste it in your browser and see the result.You can also change the dimension as you wish.

To generate image of any format

You can generate images of different formats like gif,png,jpeg and jpg.Any of the following formats can be used.The image extension can be placed at the end of any option in the url.You can specify the required size and colour of your image in the following way.

http://placehold.it/200.png/000000/ffffff

http://placehold.it/200/000000.jpg/ffffff

http://placehold.it/200/000000/ffffff.jpeg


More by this Author


Comments

No comments yet.

    Sign in or sign up and post using a HubPages Network account.

    0 of 8192 characters used
    Post Comment

    No HTML is allowed in comments, but URLs will be hyperlinked. Comments are not for promoting your articles or other sites.


    Click to Rate This Article
    working