Update, May 7: HTC and Samsung both issued updates that tweaked the camera software on their flagships, so we took new samples, made new crops and updated this article accordingly.
As usual, we took both phones and shot several camera samples with each. We've prepared various crops to highlight the differences in image quality and we've included the full-resolution shots if you want to make your own comparisons.
First, let's talk Field of View (FoV) - how much can you fit in the frame with each camera. According to EXIF info, the HTC One camera is a 28mm (in 35mm equiv.) wide-angle camera, while the Samsung Galaxy S4 is narrower at 31mm. It's noticeably narrower than the Galaxy S III too, here's an illustration of the FoV of the three phones.
Now let's talk resolution - the Galaxy S4 boasts 13MP while the One only 4MP. The pixels, sorry, UltraPixels on the One are bigger, so per-pixel detail should be better. For the first couple of crops, we upscaled HTC One photos to 13MP, which is the fair way of comparing amount of resolved detail (downscaling reduces detail).
As you can see, the difference is night and day. There's just not enough resolution in HTC One photos for fine detail and the high amount of noise sure doesn't help. Also defects like over-sharpening halos and purple fringing become pretty obvious. The contrast is punched up a bit too high, and colors are off.
Update, May 7: HTC managed to reduce the noise level in HTC One photos, which in turn improved the detail. Still, there is some noise and the oversharpening halos remain though they've been reduced since the update. The Samsung Galaxy S4 also shows an oversharpening halo, but less noise. Color accuracy goes in favor of the One with the S4 preferring the slightly oversaturated look.
The Galaxy S4 captures far more detail (see bricks, wall texture, foliage) and the noise level is relatively low (check the sky). It shows over-sharpening too, but no purple fringing and better color accuracy.
Update, May 7: The difference in fine detail remains strongly in favor of the Galaxy S4. There's noticeable noise in the sky in the HTC One photo, which can be seen even without upscaling.
While upscaling is the fairer way to compare fine detail, downscaling is probably the more common scenario (a FullHD TV, for example, has only 2MP resolution and most photos you share on social networks get downsampled). So we tried downscaling the Galaxy S4 photos to 4MP to see what that does. Note that the higher resolution of the Samsung S4 lets you crop the photo, while cropping an HTC One photo runs the risk of going below 1080p resolution.
Anyway, this comparison isn't favorable for the One either. The fine detail just isn't there and there's noticeable noise, despite the large pixels. The Galaxy S4 photos see the noise level drop further and are far sharper overall.
Update, May 7: After the update, the HTC One managed to retain more fine detail, which got it closer to the detail in the downscaled Galaxy S4 photo. The image is still not as sharp, but it's a noticeable improvement from the Taiwanese company. Unfortunately, the phone messed up the white balance, which gave the image a blueish tint.
Update, May 7: Here are the camera samples used to make the crops.
Some photos have bright highlights and dark shadows, which is where the HDR mode kicks in. We snapped photos with HDR both off and on with the two phones. Here's a crop of the images. Note that the Galaxy S4 photos were downscaled to 4MP as we're looking at dynamic range rather than fine detail.
The Galaxy S4 HDR mode takes a while to process the image but it yields great results. It mostly brings out detail in the highlights and gives shadows a slight boost. The HTC One is faster but did almost nothing for the shadows and more often than not ruined the highlights.
Update, May 7: After the update, the HTC One HDR mode does much better in bringing out detail in the shadows, but still spoils the highlights a bit. The S4 situation is similar with better results in the shadows. Note that both phones changed their color rendering with HDR mode on, which lead to some loss in color detail.
Update, May 10: We also tried out the sweep panorama modes. The Galaxy S4 produced the higher resolution shot (a whopping 60MP image) and it shows only minor stitching problems. The HTC One did a slightly better job at stitching, but its panorama had pretty low resolution (only 10MP) and there's noticeable purple fringing.
Both phones captured about 360 degrees (the Galaxy S4 actually goes a little further) and did well considering this is about as difficult as sweep panoramas go with near and far objects and well-lit and shadowy areas.
Finally, you can use our Photo quality comparison tool for another look at the Galaxy S4 and HTC One.
Winner: Samsung Galaxy S4. It's pretty clear that things are going in favor of the Galaxy S4 here. It produces sharper photos with better colors and there's resolution to crop things out. The narrower FoV is not ideal but it's not a deal-breaker.
The HTC One lost this round, though to be fair it was never expected to win a head-on fight in good lighting conditions. Its photos are certainly good enough (even better after the update) if you'll post them on Facebook or show them off on a TV, but don't come close to the samples produced with its competitor today.