The iPhone 5 fared well, though it was a close contest with the S4 in some areas. The HTC One was good in low-light conditions.
HTC, in fact, is a good example of a company trying to push the envelope on camera tech. The One has an Ultrapixel camera (see image at bottom) with larger sensors that pull in more light, boosting low-light shots.
Meanwhile, the Samsung S4 boasts a 13 megapixel sensor versus the iPhone 5's 8MP, which makes a difference in photo size, as CNET Reviews points out.