Qraft

Color Depth

Color depth (bit depth) is a measure that shows, as a number of bits, how many colors one pixel of a digital image can represent. With 1 bit, it can represent 2 colors, black and white; with 8 bits, 256 colors; and with 24 bits (8 bits each for RGB), about 16.77 million colors.

A QR code is essentially a 1-bit image. Each module represents information with two values, "dark" or "light", and no intermediate colors exist. This two-value nature is what makes fast recognition by scanners possible. If there are gray or intermediate-colored modules, the scanner hesitates when judging between "dark" and "light", which causes read errors.

In design QR codes, full-color (24-bit or more) color depth is used to customize the colors of the modules. However, even as the design gains more freedom, you need to maintain a contrast that lets each module be told apart as "dark" or "light". Using dark blue or dark green for the dark modules is no problem, but using pale yellow for the light modules makes them impossible to distinguish from a white background.

The relationship between the file format and the color depth when saving a QR code image is also important. PNG keeps the color depth with lossless compression, but JPEG uses lossy compression, which blurs the boundaries of the modules. For saving QR codes, PNG (1-bit or 24-bit) or SVG (vector) is recommended.