Cameras read barcodes in the same way that any barcode reader functions: the software analyses the contrast between filled and empty spaces in order to understand the shape of the code, and then decodes the pattern into an alphanumeric string. Depending on the code type, this either means analysing a simple horizontal line (as in a 1D barcode) or analysing a square (in the case of a 2D barcode). Either way, the basic principle of reading in a pattern of light and dark is the same. The advantage of using a camera instead of a more traditional barcode reader is that camera systems are better-suited to gauging barcode quality – a more traditional barcode reader can only really return a readable or undreadable result.