Before, during, and after the introduction of the iPhone 3G, many people were hoping/asking/whining for a better camera in the iPhone. One with more than 2 megapixels, that is. Unfortunately, more megapixels wouldn't have made the iPhone camera better. The extra pixels wouldn't help with anything, in fact, and could even hurt under some circumstances.

Here's why. Obviously, there are many cameras with a higher megapixel count that shoot better pictures than the iPhone. But giving the iPhone more megapixels won't make it shoot better snapshots any more than buying an expensive car will make you rich. It's the other way around: because these cameras have better lenses, they can get good mileage out of better image sensors. The first problem with the iPhone's camera lens is that it can't focus. Unless Apple has been successful in hiding the iPhone's autofocus capability from all of us for the past year, the iPhone's camera has a fixed lens. The iPhone's lens must be able to produce a (reasonably) sharp image regardless of the distance between the phone and the subject, because it can't adjust its focus. There are two ways to do this: be more liberal in what's accepted as "sharp" and make the lens opening (aperture) smaller.

Apple managed to strike a fairly reasonable balance here: the iPhone takes pictures that are within the sharpness range expected from a 2 megapixel camera, while the aperture is a respectable f/2.8. If Apple were to use a higher resolution image sensor with the same lens, the pictures wouldn't be any sharper—and 2MP sharpness in a 5MP camera is just not acceptable. The other option would be to reduce the size of the lens opening, but that way, the amount of light that reaches the sensor is reduced and the iPhone would have an even harder time taking decent photos under dim lighting.

The other problem is that the more megapixels that are crammed in the same size sensor, the smaller those pixels get. Since individual pixels are gathering less light, many will be "underexposed" and produce a lot more noise (see long explanation and examples.). That's the last thing that the iPhone's camera needs. And, some would argue that the iPhone doesn't have enough flash memory to store lots of high-megapixel photos. But I'd think that Apple would be happy to solve that particular problem by selling would-be iPhone photographers a higher-capacity camera phone.

So 2 megapixels is just fine, thank you—until such time that Apple manages to shoehorn an autofocus lens into the iPhone, thereby removing the need to control focus with the aperture. (Yes, the Nokia N95 has autofocus, but it's also nearly twice as thick as the iPhone.) The software that determines the white balance, on the other hand, can use some work.