The measuring is done against a solid background that X-rays can't penetrate. The image receptor is equipped with a material that lights up when exposed to X-rays in an airport scanner. So objects that block X-rays—such as your phone or laptop—will show up as dark on the image while everything else will be bright.