So let's look at the hardware before and software on paper before we begin analyzing the results. We're dealing with two very different approaches to mobile photography and it shows from the megapixel count, the software that's provided, the sensor and pixel size.
The HTC One (M8) comes with a modest-sounding 4 MP camera with a 1/3.0" sensor with a maximum resolution of 2688 x 1520 in 16:9 aspect - meaning wider images in comparison to the 4:3 ratio. Each pixel sits at 2 Ám which is pretty big for a smartphone. The aperture is an f/2.0 so it should allow for more light to reach the sensor. The field of view is relatively wide at 28 mm. Unlike its predecessor, the HTC One (M8) doesn't offer optical image stabilization. It does have a 5 MP front-facing camera, though.
Thanks to the latest generation ImageChip 2, the HTC One (M8) allows for digital image stabilization, and makes sure you get sharper images with less noise and better overall quality. The One (M8) also has a new autofocus system, allowing for faster than ever performance.
Then there's that redesigned dual LED, dubbed Smart Flash. It utilizes two LEDs in different colors (a warm and a cool one). The camera system can analyze the available scene light and by mixing and matching the temperature (the color of light) of the combined light output by the two LEDs, it produces more natural illumination for your photos.
But what's more interesting is the secondary camera lens, above the main one. It's a sort of a rangefinder. Its job is to create a depth map of your scene, which enables cool effects such as background blur (faux bokeh) or refocus your images after the shot. It can even allow for 3D-like photos with an extra layer of depth, which is visible when you tilt the phone (a parallax view). The Xperia Z2 offer similar effects but it takes a few shots with its single camera to achieve it.
The HTC camera app is unified and let's you choose Still camera, Video, Zoe camera, Selfie, Dual Capture (front and back camera simultaneously) and 360-degree Panorama, which allows both portrait and landscape oriented shooting. The Zoe Camera shooting mode records the necessary video and images to create the beautiful animated photo reels that you will find in the dedicated Zoe app.
In the settings you can adjust the usual functions such as exposure compensation, the ISO, white balance.
The second lens allows for cool shooting modes like UFocus, where the background to your subject is artificially blurred to create bokeh (out of focus area), Foregrounder, which creates a sort of motion blur around your subject, Colorize, which aims to accentuate one color in the frame, Seasons creates faux season effects such as snowflakes. The best one by far is Stereoscopic - it allows you to view 3D-like images on the screen of the phone by moving it and is really cool.
A clever new accelerometer-based trick allows you to start the camera even while the phone is locked in standby. With the screen off and the phone in landscape orientation, pressing one of the volume key activates the camera.
The Sony Xperia Z2 comes with a 1/2.3" sensor with a maximum usable resolution of 20.7 MP in 4:3 aspect. However most of the time you'll be shooting stills at 8 MP in either 16:9 or 4:3 aspect anyway. Depending on the shooting mode you'll either get 5248x3936 pixel resolution images (20.7 MP) or 3840 x 2160 ones (in 8 MP). Pixels are much smaller at 1.1Ám each. The aperture is f/2.0 as the HTC while the Sony G lens is a little wider at 27 mm. There's no optical image stabilization here either. The front-facing camera on the Sony Xperia Z2 is a 2.2 MP unit.
There's a physical shutter button on the Sony Xperia Z2, which cameraphone enthusiasts will find refreshing. There's also digital image stabilization in the form of Steady Shot, although that hardly counts.
Sony's Xperia Z2 features two camera interfaces. The default one is Superior Auto mode. It automatically chooses one of the many shooting modes tuning every aspect of the image quality. This includes color saturation, contrast, metering mode. Superior Auto locks your resolution at 8 MP in 16:9 aspect and you can't do full-res 20.7 MP shots.
There are other shooting modes like Background Defocus, which does essentially what UFocus does just without the fancy hardware - it's all software driven.
Manual mode lets you control the settings of the camera down to resolution and aspect. Here's where you can find HDR shooting (which strangely isn't offered as a different shooting mode). Here's where you can also use 20.7 MP mode.
But manual mode is a bit disappointing as well. There's an exposure compensation slider, a white balance selector, and also ISO, metering and some focus modes appear buried in the settings menu. And that's all - with a name like that we were hoping for some manual focus, or at least a way to tune contrast, saturation, sharpness and so on.
The Sony Xperia Z2 also offers Sweep Panorama mode - it allows you to take multiple images in a sweeping motion and then have a panorama made in-phone. You can shoot either in portrait or landscape mode.
Timeshift burst is a cool mode - upon choosing it the phone will snap a burst of images before you even hit the shutter. That way you might not miss an important moment. AR effect mode (Augmented Reality) enriches the scene with virtual characters, effects and props such as mountains or forests. Sadly the mode limits your photos to 1080p resolution.
Video modes on the HTC One (M8) are almost unchanged since its predecessor. The camcorder maxes out at 1080p@30fps shooting but there's also 1080p@60fps, up from last year's 720p@60fps mode on the HTC One (M7). Slow motion video capture is recorded in 120 fps at 720p - you can edit slow motion movies to show only portions of the clip in slow-mo, like on the iPhone 5s, which is cool. There's also HDR video at 1080p resolution.
The Sony Xperia Z2 matches the HTC One (M8) toe to toe with the 1080p@30/60 fps along with Timeshift Video which records 720p@120 fps and then allows you to edit the video to play only a portion in slow-mo. But the Sony Xperia Z2 does add 2160p (UHD) video at 30 fps. This video mode is essentially twice the resolution of the HTC One (M8)'s back-facing camera.
To sum up this is what we've noticed as far as advantages go. In the next chapter we'll be looking at the actual samples from both cameras and camcorders so this is only the preliminary outlook.
HTC One (M8) over the Sony Xperia Z2
Sony Xperia Z2 over the HTC One (M8)
Winner: Sony Xperia Z2. The HTC One (M8) does have more features for its still camera, but the Sony Xperia Z2 clearly has the superior hardware - larger sensor of higher resolution and with 4K video recording to boot.