The latest battle in the war of smartphone cameras appears to be for background defocus supremacy. HTC launched the HTC One (M8) with a second sensor for depth detection, perhaps the largest offensive in the bokeh wars.

Samsung and Sony both offer background defocus modes in their camera apps and now Google has resorted to Guerrilla tactics, releasing a new Camera app that works with all Android 4.4 KitKat devices and, unsurprisingly, offers its own take on background defocus.

But who will emerge victorious? We've pitched these different devices against each other to see what they offer.

What are they trying to achieve?

The effect is designed to make the subject stand out against the background, with the subject sharply in focus against the softly blurred background.

This is common in portraiture, it's used frequently in video, often with the classic bokeh effect of turning light points into circular blooms in the background. It's really about pulling out the difference between the focused and out of focus areas.

READ: What is bokeh? Here's the photography effect explained

This is easy to achieve with a wide aperture lens and is commonly used for artistic effect by DSLR users. Below we've taken a shot to show you what you get at f/1.8 with a DSLR. The camera used was the Canon EOS 600D with 50mm f/1.8 lens.

background defocus htc one m8 vs samsung galaxy s5 vs sony xperia z2 vs google camera app image 2

The big difference between the smartphone effect and what you'll get from a lens on a DLSR camera, is that phones are applying it after the fact, giving you more options, but also giving you results that are less inconsistent. You get more options, for example you can take the shot then choose the focal point which you can't do with a camera, and of course, you have your phone in your pocket all the time, so it's ready to roll at a moment's notice.

HTC One (M8)

The HTC One (M8) has two sensors on the back. The second sensor is designed to collect depth data only, allowing the M8 to slice up the scene and identify what sits where.

background defocus htc one m8 vs samsung galaxy s5 vs sony xperia z2 vs google camera app image 3

The advantage this offers is that it has all the information it needs to create the background defocus effect from any photo you take. You can take the shot, enter the Ufocus editing option and selection your focal point: the rest is blurred out. You can select foreground or background focal points and the results are quick and easy to achieve as you don't have to use a special shooting mode.

But you'll notice that the outline around the cup isn't as precise as that from a DSLR: there's also a patch on the window that's still in focus, so the results are rather mixed and the background look a little cold in this test shot.

Samsung Galaxy S5

On the Galaxy S5, background defocus is achieved using the "selective focus" shooting mode. The first thing to note is that you have to select this shooting option, or you won't be able to create the effect. 

It is displayed on-screen as an option to toggle, however, so it's easy to get to and you'll have to keep the camera steady as it captures a couple of shots and then processes the image.

You're then presented with the option for near focus, far focus or pan focus, which puts everything in focus as it would a normal shot. You then select what you want and save.

background defocus htc one m8 vs samsung galaxy s5 vs sony xperia z2 vs google camera app image 4

In this example, the SGS5 has lumped together the cup in the foreground and some of our very own Britta O'Boyle in the background and then blurred the rest. The results will depend on the scene, of course, and in this example, the SGS5 doesn't cope too well. 

Sony Xperia Z2

On the Sony Xperia Z2, background defocus is a camera app, so you have to select the mode before taking the shot. But you are then given a range of options to tailor the shot to your liking. You can select whether you want circular, vertical or horizontal blurring (which can give the effect of movement), as well as being able to select the intensity of the result.

background defocus htc one m8 vs samsung galaxy s5 vs sony xperia z2 vs google camera app image 5

The Sony Xperia Z2 didn't like our test scene, again with a mixture of fore and background in focus, but like the Samsung, results will depend on what you're looking at and the relative distance of all the elements of the scene.

Google Camera app

Of course you're not entirely dependent on having one of the latest smartphones to get this effect. With the release of the latest Google Camera app - available from Google Play - you can now get the feature on any Android device with Android 4.4 KitKat. The new camera app is the stock app for the Nexus devices, but can also be installed on any of the phones mentioned above.

The app offers a range of options, accessed via a swipe in from the left. It's called Lens Blur and uses the same technique as the HTC One to gauge depth, asking you to move the phone. This lets the phone get a better idea of what is where in the scene as it has different viewpoints, so it can separate the different layers.

Capture is easy enough, but it's not the most intuitive system, as you then have to swipe in from the right to open that image you've just taken in the camera roll, at which point the processing takes place. You can then select the focal point (much as you can on the HTC One M8), as well as changing the level of blur that's applied.

 background defocus htc one m8 vs samsung galaxy s5 vs sony xperia z2 vs google camera app image 6

Aside from the awkwardness of having to remember to immediately apply the effect, the results are pretty good. In our test scene we used the app on the Xperia Z2 and the Google Camera app has done a better job of separating fore and background, although it does look a little artificial. However, the output is at a lower resolution, with a 1024 x 768 resultant image.

Summing up

The results are different between these approaches. The best result is from the DSLR camera producing the image using the lens aperture, rather than trying to split and digitally blur. The HTC One is simple and direct, because it has the ability to always shoot with depth data, so you can apply the effect whenever you feel like it, but it isn't flawless.

The Samsung and Sony both produced mixed results in this setting, not really being able to distingish foreground and background with enough accuracy in the challenge we set it and have the disadvantage that you have to shoot in that mode to be able to produce background blur results, so it has to be a conscious decision at the point of capture.

The Google Camera app, however, works fairly well, thanks to the movement you use to help it sense depth. The downside, however, is limited resolution output and, again, you have to select the mode before you take the shot.

Of course, it's worth bearing in mind that different situations will product different results for these different phones, so just because some coped better than others in this test, doesn't mean that's a definitive result. If you want to know more about the phones used, make sure you read our HTC One (M8) review, Samsung Galaxy S5 review or Sony Xperia Z2 review.

Just bear in mind that if you want a nice blurred background and consistent results, a DSLR is still your best friend.