Camera comparison: Sony Xperia Z2 vs Samsung Galaxy S5, LG G2, HTC One (M8), iPhone 5s
This one is also a tie between the Sony Xperia Z2 and the Samsung Galaxy S5. Although the two capture details differently, we can't say that one of them is better than the other at that.
By default, the Z2 starts in Superior Auto mode and takes 8MP photos, which are pretty much scaled down and enhanced 20.7MP ones – the produced images are very rich in detail and mostly free of artifacts. In case it is needed, the 20.7MP photo resolution is available in Manual mode, but once you zoom in close on these full-res images, you'll see plenty of unwanted artifacts. That's one of the reasons why an average user is advised to stick with Auto mode instead.
As for the Samsung Galaxy S5, its 16MP photos look very detailed indeed, but the camera's noise reduction algorithms along with the added sharpness render these details somewhat unnatural.
The LG G2 has a rather unique approach to capturing details in photos. We suppose that you will find these either very natural, or very awkward. To be more specific, 13MP photos from the G2 have very soft details and very little noise.
The iPhone 5s produces photos that are very high on details, especially for their resolution of 8MP. Details are natural, without any unnecessary sharpness, and digital noise is hard to spot in well-lit scenes.
Last in this category is the HTC One (M8), which isn't a surprise. Its 4MP photos are usable, but the phone's rivals are a league ahead. Zooming in on the One's photos reveals the absence of fine details. Noise is rather easy to notice.