The main task of doing a correct passport photo on your own is to properly crop it. Suppose you need a 2x2 inch photo. What does it mean? How do you know that your photo is 2x2 inches? Or maybe it is 1.5x1.5 inches only? The answer is this: you need to multiply the size in inches by a dpi resolution of the photo and get a pixel size of it. So, for example, your resolution is 300 dpi, so 2x2 inch photo becomes a 600x600 px photo.
You know now that you need a 600px by 600px photo. But if you take a photo right from your camera and cut a 600px by 600px piece out of it, it is highly unlikely that the result will be right. I just went ahead and took my own photo and cut a 600px square from it, but it contains just the nose and eyes. Even my head doesn't fit into it.
So now you realize that you first need to scale the picture the way so when you cut a 600x600px square out of it, it will contain the whole head of the proper size and shoulders on it. Great, but how do you calculate the scale ratio? How do you calculate the distance between the eyes and the bottom of the photo which is there in the requirements?
But there is a solution now: visafoto.com. It does everything automatically: picture scaling and cropping, head tilting fix, clearing the background, red eyes fix, and contrast adjustments.
So if you have your photo ready, you can convert it to a correct passport or visa photo right now at visafoto.com.