With the compact camera market steadily dwindling, it's an increasing truth that the best camera will be the one in your pocket, i.e. your phone's camera. In recent years we've been truly spoiled with just how good these cameras have become.

In 2017 the Google Pixel 2 XL showed that just one camera and no gimmicks were required to be an awesome camera. Many proclaimed it the phone camera to beat.

Then, in 2018, Huawei unleashed the P20 Pro, which took a different tact: its triple lens rear cameras (co-engineered with Leica, no less) crammed in multiple features, from super-high resolution, to zoom and artificial intelligence. Some may gawf at the apparent gimmickry of such a forest of features, but beneath it all the P20 Pro, too, proved itself a phone camera pro.

Wanting to know which of the two is best for photography we used both phones side-by-side over a week. Here's our Huawei P20 Pro versus Google Pixel 2 camera showdown...

First, the camera specs

  • Huawei P20 Pro: triple rear cameras
  • Google Pixel 2 XL: single rear camera
  • P20 Pro: 40MP colour (1/1.7in) with f/1.8 aperture; 20MP mono with f/1.8 aperture; 8MP 'tele' with f/2.4 aperture
  • Google Pixel 2 XL: 12.2MP (1/2.6in) with f/1.8 aperture
  • Both: Optical Image Stabilisation (OIS), phase-detection autofocus, LED flash

Resolution and sharpness

  • Huawei P20 Pro: Shoots 10MP by default (8MP for 3x zoom; 40MP when instructed)
  • Google Pixel 2 XL: Shoots 12.2MP by default

First up: resolution. It's not the be-all-end-all of photography, especially when dealing with small-scale sensors and limited lens sharpness as is typical of phones, alongside the unlikely need to use full-size images or heavily crop. The 12.2-megapixel Pixel 2 XL may sound modest, but we think it's got the output size spot on; conversely the 40-megapixel sensor in the P20 Pro may sound excessive - but it's rarely used at full resolution (it can be within settings, however), instead utilising multiple camera sensors and intelligently binning pixels to produce 10MP images by default.

Sharpness comparison (above, from left to right): gallery shows Pixel XL 2 full size, then 100 per cent crop, then Huawei P20 Pro full size, then that at 100 per cent crop.

Beyond resolution it's actually perceived sharpness that gives a sense of a crisper, almost resolute image. It's why camera makers use software processing to edge sharpen images. Having eyed-up daylight photos taken by both Pixel XL 2 and P20 Pro, the Google approach takes a slightly subtler touch, while the Huawei uses harder processing, which often gives the perception of the Huawei having sharper images. That said, while the Huawei is nine times out of 10 the winner, sometimes it over-sharpens its images, resulting in "jaggies" along diagonal edges.

Zoom

  • Huawei P20 Pro: Up to 3x optical zoom; 5x digital zoom (can extend to 10x)
  • Google Pixel 2 XL: Digital zoom uses RAISR algorithm

Increasingly phone cameras are adding a second lens with a longer focal length, to get closer in on the action and provide zoom without requiring any of the moving mechanics or definition loss. The Huawei P20 Pro's third lens offers a view three times that of its other two cameras. The Pixel XL 2 doesn't offer a second camera, but does use Google's Rapid and Accurate Image Super-Resolution (RAISR), which "incorporates machine learning in order to produce high-quality versions of low-resolution images".

Having used both, we have to say Huawei walks all over Google in this department. Having a dedicated zoom lens to utilise is unrivalled in terms of the detail it produces, while the 40MP sensor can also be used (well, a portion of it) in tandem with the 3x zoom lens' data to derive better quality data.

Low-light night photography

  • Both: f/1.8 maximum aperture, Optical Image Stabilisation (OIS)

Darker conditions are always challenging for any camera. Few phone cameras are proficient at avoiding the image noise that occurs from needing to amplify the signal to produce an exposure from a dark scene.

If it's low-light that you want to shoot in, however, then these two phone cameras are among the best on the market (only the Samsung Galaxy S9+ can really challenge). Both have optical image stabilisation, too, which can aid with handheld shots when a slightly longer shutter speed is required.

Looking at the Pixel XL 2's results at night, it does a good job at quashing much of the image noise in shadow areas, but can't do so entirely. The Google phone also loses a large amount of colour when conditions dim, a typical result of such conditions. By contrast, the Huawei P20 Pro delivers even cleaner images, less image noise, and punchier colours.

Furthermore the Huawei is far better at negating lens flare than the Google, for consistently cleaner and better-looking nighttime shots.

HDR (high dynamic range)

Further to above, we also found the Huawei to offer wider dynamic range (HDR) in low-light images, which means less blown-out highlights and more balanced exposures.

This isn't always the case - such as an indoor shot at a castle with a grated window - but when it comes to direct light sources in nighttime photos, the Huawei is a step ahead in balancing out the exposure.

HDR control is available in the Pixel XL 2 from within the settings; in the Huawei it appears to always be set to auto, or you can specifically select the HDR mode from the More section within the camera app.

Portrait mode / bokeh

  • Huawei P20 Pro: Portrait mode with 4D focus; Aperture mode with f/0.95-f/16 settings
  • Google Pixel 2 XL: Portrait mode (no additional settings)

One thing that seems to be all the rage in phone cameras these days is Portrait mode. The idea is to locate a subject, separate them from the background, then blur what's behind (an effect called bokeh) using software (hence sometimes called faux-keh, jovially). No one manufacturer has go this 100 per cent correct to date, as often background elements are confused for foreground, or certain edges blur when they shouldn't - and let's not get started with subject's hairlines causing all kinds of difficulties.

The Huawei P20 Pro, however, has a pair of lenses, thus can derive depth data from between the two for more accurate depth layers and implementation of this effect. However, it still doesn't work properly all of the time, despite its 4D focus and automatic face detection. The Google Pixel 2 XL uses just the one lens for its Portrait mode, so while it's theoretically on the back foot, its results are also passable.

That's as far as Google goes with this software. Huawei, in partnership with Leica, has gone even deeper, offering an Aperture mode that's designed to recreate the ultra-wide aperture lenses of pro cameras. The f/0.95 setting massively blurs the background, but it can be selected all the way down to f/16 (encompassing f/1.2, f1/4, f/2, f/2.4, f/2.8, f/3.2, f/3.5, f/4, f/4.5, f/5.6, f/6.3, f/7.1, f/8, f/11, f/13 and f/16 - the smaller the number the greater the blur, the bigger the number the more that will be in focus from front to back).

Huawei's idea is sound, but the delivery can often really smoosh image details into oblivion - especially when looking at the full size image. We've used the mode for food photography, which looked great on screen, but which then showed its true colours and excess blur on closer inspection. Thus we tend to leave this mode off; you'll see how much sharper the Google looks in the above comparison, as one example.

Artificial Intelligence (AI)

  • Huawei P20 Pro: Master AI is always active, learns as you shoot, can be manually disengaged
  • Google Pixel 2 XL: Artificial intelligence is always active behind the scenes, little fuss made about it

A major part of the Huawei P20 Pro's sell is its artificial intelligence (AI). The device has a neural processing unit (NPU) as part of its Kirin 970 chipset, which aids with learning. The camera app has also been fed a million images and machine learning helps it differentiate between subject and scene types, without you needing to do a thing. There are wide range of scenes, from pet mode, to dog mode, landscape, portrait, and beyond - and when the camera auto-selects one it lets you know on screen, where it's then possible to hit the 'x' and switch it off, if undersired. Interestingly, if you do this a lot for a given scene type, the phone will learn and query whether you wish to disengage a specific AI scene mode (or the whole system can be switched off within settings).

By contrast the Pixel XL 2 has artificial intelligence working behind the scenes, but doesn't make a big song and dance about it. Like the way the camera handles colour and exposure, its treatment of images and AI is more classic, lighter of touch. It, too, can boost image colour and contrast as necessary, but like much of how Google's software operates, the company isn't saying a great deal more about what's going on, when, or how.

In terms of results, the Huawei can be great for certain scenes. Portraits, food and night scenes, as three examples, such like help adjust the exposure accurately. Problem is, some of its modes are overkill: Greenery and Blue Sky are two prominent examples, which seem to kick in at the slightest sense of green grass or a sky, over-saturating the results a little too far. Sometimes text in an image will make the camera opt for Document Scan, which auto crops and distorts an image for flatness - useful for documents, useless when there's a billboard or sign in a larger image that confuses the camera.

By contrast, the Google approach looks far less saturated and contrasty. We'd like a little more pep, perhaps, but equally like the Huawei to dial things down a touch.

Point being: AI can be great, but it can be excessive and really needs to be tweaked to perfect its potential. We're sure the next-gen device will step things up even further (and other work is happening, as the company's Honor 10 has a Panda Mode within its AI Camera).

Colour balance

Auto White Balance (AWB) is at work behind the scenes in both cameras, or you can select Manual/Pro mode to select your own white balance settings. As the name suggests, this controls the colour temperature, the goal being to provide the most natural, true-to-eye colour result in each case. Thing is, the human eye sees very differently to a camera, so consistency here can falter.

By and large the Huawei is the more balanced, natural shooter of the two. When shooting clothing through a window, for example, the AI knew what the content was and adjusted accordingly, while the Google failed to dial out the yellow caste entirely.

That said, with some food photographs (the tuna tartare further up the page, for example), the Pixel XL 2 has handled the scene more deftly. And, as we've said above, the overkill Blue Sky and Greenery modes of the Huawei can often murder an otherwise innocent landscape scene. So there's no outright winner in this regard: it's six of one, half a dozen of the other.

Which focuses faster?

  • Both: Phase-detection autofocus pixels
  • Huawei P20 Pro: Continuous autofocus

It's not just the image quality that matters, of course, it's the journey of getting those images captured in the first instance.

While both Google and Huawei offer phase-detection autofocus pixels for rapid touch-to-focus - and both are really quick. However, the Huawei is slightly more advanced, with live continuous autofocus pixels showing on screen as active squares when tracking moving subjects. The focus won't always go precisely where you wish, but it's easy to tap to correct.

Verdict: Which camera is best?

For us it's the Huawei P20 Pro that has the best camera in any phone right now. It's great for low-light shooting. It's fast to open the camera app, focus and capture. The zoom works very well, too. And while three lenses might sound like overkill, their mixture of focal lengths, colour and mono, and resolution combine to great effect.

That said, we thought the Huawei would walk over the Pixel XL 2 in every department - but that's not the case. In daylight images, the Pixel is largely comparable to the P20 Pro. Google's take is to handle image processing more subtly than Huawei, with a gentler touch that can sometimes work to its advantage. Ironically, it's the P20 Pro's artifical intelligence that can sometimes cause it problems, with over-eager saturation and auto scene-recognition not always being especially accurate.