I'm trying to create 1000 random profile pics of people defined by demographics. e.g : 85% Women, aged - 20 - 29 , Nationality : American and so on...
Does anyone know any services that'll do this for me? If not does anyone have any good ideas on how to do it with an emphasis on realistic profile pictures and their names?
Thanks
56 Answers
Of course it would not be allowed to grab pictures/profiles from Facebook without the users knowing about it, but there are several generators out there for this:
3<html> <body> <script> function getRandomInt() { return Math.floor(Math.random() * (10000 - 5)) + 4; } for(var i=0; i<10; i++) { imgUrl = "" + getRandomInt() + "/picture?height=200&height=200"; elem = document.createElement("img"); elem.setAttribute("src", imgUrl); elem.setAttribute("width", 200); elem.setAttribute("height", 200); document.body.appendChild(elem); } </script> </body> </html>1<html> <body> <script> function getRandomInt() { return Math.floor(Math.random() * (10000 - 5)) + 4; } for(var i=0; i<10; i++) { imgUrl = "" + getRandomInt() + "/picture?height=200&height=200"; elem = document.createElement("img"); elem.setAttribute("src", imgUrl); elem.setAttribute("width", 200); elem.setAttribute("height", 200); document.body.appendChild(elem); } </script> </body> </html>1Just replace the value after /u/ with any number. There are several million photos. I suppose you can guess who picture #1 belongs to. Optionally, you can set the size using the s parameter. In this example it is 360 pixels in height and width.
But please don't go hog wild and start downloading thousands of images in a short period of time, otherwise Github will probably notice that and start to implement limits which will ruin it for all developers. If you keep it to a thousand and avoid repeatedly calling their server, you will not get noticed as though you were a bot. A better solution is to perform a one-time download of all the images you need and cache them and use them from your own device or server rather than constantly hitting Github's server.
Better yet, there's a free API at:
It allows you to generate about a million random users or 1,000 non-random users.
it gives gender-specific pictures
<html> <body> <script> function getRandomInt() { return Math.floor(Math.random() * (10000 - 5)) + 6; } for(var i=0; i<10; i++) { imgUrl = "" + getRandomInt() + "/picture?height=350&height=350"; elem = document.createElement("img"); elem.setAttribute("src", imgUrl); elem.setAttribute("width", 350); elem.setAttribute("height", 350); document.body.appendChild(elem); } </script> </body> </html>1