Creating a collision map from an image

I’m making a platformer and I need to generate the collision map from a black and white image. I tried checking each black pixel and adding an object but that made it run way too slow. What would be a good way to set up the objects so he can walk on the black parts of the image? Thanks in advance.

http://www.upload3r.com/serve/200609/1245526628.png
That would be the collision mask and somehow I would take that and make objects from the black areas and then draw the background over it.

If the image can’t change during the level I would just parse it out when the level loads. If you want to turn it into a tile map in the game you could create a tile array using BufferedImage().getSubimage(x, y, w, h) to get an area, then scan threw the pixels with BufferedImage().getRGB(x, y) breaking out and setting the tile once you figure out what it is. This method would be very time consuming if run every update so it’s really only good for a map that doesn’t change very often.