Monday, February 4, 2013

Generate images for testing

I recently needed to generate dozen of image files for testing purposes. I wanted different size and i want file to be named after the size and the size to be printed into the image.

One way to do this is go and use paint for the job. But I am lazy.

I found nice web service that does exactly what I wanted - http://dummyimage.com

So I decided to combine some excel spreadsheet with curl(http://curl.haxx.se) and to create a simple batch to generate images.

here are few lines of my batch:

curl -o images\50x50.png "http://dummyimage.com/50x50/0f0/000.png"
curl -o images\100x100.png "http://dummyimage.com/100x100/0f0/000.png"

and this results in images like this in images folder




Above batch lines was generated using excel concatenate function based on 2 column that defines X and Y so I can easily change the parameters.


That is all :-)


No comments:

Post a Comment