Height Maps For Map Generation?

Is it possible to use a sort of image to generate rooms in game? For example the black pixels represent walls, blue pixels water and red pixels lava?

Continue to help post