Comparing the image quality of the two cameras will be quite difficult due to the massive resolution difference. The Samsung Galaxy S5 camera has 16MP still resolution, while the HTC One (M8) has only a quarter of that -4MP.
This raises the question how do we compare the two - comparing them at native resolutions is difficult because the scale of objects is quite different. Objects in Galaxy S5 photos appear over 4 times larger than the same objects in HTC One (M8) photos ("over" because of a different field of view, more on that later).
Here's what that looks like:
Some things become quickly apparent - the One (M8) has issues with shadows. Noise levels also appear to be higher in the HTC shots, but the Samsung goes a bit too far with the sharpening, which makes noise in its photos more apparent.
Let's move on to a different comparison - if you're going to share photos on Facebook, 4MP is the upper bound of photo. One (M8) photos have just a bit more resolution than a QHD screen (2,560 x 1,440), which is becoming popular with laptops. Then there are large desktop monitors and even 13" 3,200 x 1,800 laptops.
Keeping these resolutions in mind, the Galaxy S5 leaves you plenty of room to crop a photo, while the One (M8) needs every pixel it has.
We downscaled a Galaxy S5 photo to match the HTC camera's resolution. The tendency of the One (M8) to underexpose photos is apparent here too, as is the lack of resolution. The wider field of view acts against the HTC, but still everything looks a lot softer due to noise, while the Galaxy S5 gets to discard some of the noise in the downscale process.
Colors are close to accurate, though both phones oversaturate them, the Galaxy more than the One. The Galaxy S5 has the most accurate screen in terms of color rendering, but the camera ruins this balance somewhat. That said, the HTC One (M8) didn't hit the mark when it comes to white balance.
We've mentioned that HTC's camera underexposes photos a few times now, let's have a look at that. The weather wasn't quite perfect when we took the photos, it was overcast. The crop below shows how each phone captured the bright, cloud-covered sky and a part of a building that was in the shadows.
The HTC One (M8) captures more of the clouds, but leaves the shadows much too dark. Part of that is poor metering - the software decided to focus on the sky rather than the shadowy areas on the ground. HTC could rework this to achieve better results, but the One (M8) sensor has worse dynamic range, which can't be helped by software.
Back to our crops, we have a third, final direction to go - upscaling HTC One (M8)'s 4MP shots to match the Galaxy S5's resolution. Not that you would be upscaling photos, but this makes the difference in captured detail all the more obvious.
Trained eyes will quickly spot the oversharpening halos in photos taken with the Galaxy S5, but they are not too bad and you're unlikely to be viewing those in full resolution (unless you cropped most of the photo out). The HTC One (M8)'s camera just doesn't have the raw resolution to compete in broad daylight.
One way to fix the issue in the shadows of the HTC One (M8) is to enable the HDR mode. The Galaxy S5 has a slightly wider dynamic range to begin with and Samsung has had one of the best HDR modes of recent phones.
The HTD One (M8) barely does anything to highlights (which in this contra jour shot was quite necessary) and brings out a lot more in the shadows. If parts of your shot appear too dark (as will be common with the One (M8)), you can switch to HDR, it will help. That said, it drops the contrast of the photo too much, which we don't like.
Samsung's approach is more balanced and the phone develops a little extra detail in both highlights and shadows, without dropping the contrast too low.
We tested one more feature of the two phones in daylight, the panorama. As can be expected, the Galaxy S5 panorama has more resolution, but the wider dynamic range and better exposure algorithms of the Samsung also make a big difference. HTC's color balance seems off once again.
Note that both phones will take 360° photos, we only shot around 180°.
Winner: Samsung Galaxy S5. The HTC One last year had troubles competing in good light with 2013's flagships, a 2014 flagship camera blows it out of the water and the One (M8) has a very marginally improved camera (sans OIS, which makes no difference here).
The weather wasn't the best, but photos from the One (M8) were so dark they were, at times, unusable. HTC could resolve this and some of our complaints with a software update, but the hardware just isn't up to par.