large terrains

I am trying to make my terrain from a heightmap. I want me terrain to be large. What I am tring to do is load the hieghtmap and repeat it over and over making my terrain almost infinite. I need info on how to do this.

My main problem is getting the edges of the heightmap to match the height of the opposite edge so it can be tiled. Is there a paint program that will do it for me?
what is the best way to do this to speed up fps?

moved the thread to advanced