How Do i Random Generate Something like this

is there a way of random generating an image like this (real time) then load it into the game

like real time change 1 image to be like 100+ dungeons real time once

http://s7.postimg.org/4c8ujfb97/mappy.png

for ex i got this image

dungeon.png (just a blank image)

the code opens it somehow
random generates pixels to what ever they need to be
saves the image
then loads in into the game

(how i load map)
i check the pixels on the image then add blocks to different pixel colours