Internet
Fact-checked

At EasyTechJunkie, we're committed to delivering accurate, trustworthy information. Our expert-authored content is rigorously fact-checked and sourced from credible authorities. Discover how we uphold the highest standards in providing you with reliable knowledge.

Learn more...

What Is a Binary Pattern?

Eugene P.
Eugene P.

The term "binary pattern" in computer graphics can have one of two meanings. It can refer to an image that is produced by using binary or bitwise mathematical operations on two or more numbers to create some type of visual pattern. It also can be any image or sequence that consists of only true or false pixel values, usually stored in a sequence of bytes, such as a bitmap image. In both cases, the final image is produced by manipulating the bits of a sequence of bytes that, in turn, end up directly relating to one or more pixels on a display. Some of the uses for a binary pattern include masking, procedural texture creation, character storage and display, and other visual operations that require an icon-like symbol as opposed to a full-color image.

In the sense of creating some type of texture, a binary pattern is created by applying a bitwise operator to a number or sequence of numbers. The bitwise operators, which include AND, OR, NOT, and exclusive or (XOR), work by taking two sequences of bits and determining a true or false value based on the condition of each of the operand bits. The usual result is an integer of a given length that can be broken down into red, blue and green values related to the colors on a screen, or can be used as a single byte that is an index into a color table.

Man holding computer
Man holding computer

Different algorithms, loops or other factors can be used to generate a sequence of numbers that can be used with the binary operators to create a repeating binary pattern. One example of this can be seen in a program that XORs the X coordinate of a pixel only if it is evenly divisible by eight. This will create a binary pattern of vertical stripes on the screen that are spaced 8 pixels apart and increase in brightness as the X coordinate increases. The masking nature of bitwise operations means the pattern can be applied to any existing image or color scheme to cause the bars to appear as brightened or inverted areas of the underlying colors as opposed to solid lines.

Another use of the term "binary pattern" involves storing images in a binary way, usually as the bits of a byte. When the image is drawn, the sequence of bytes is treated like a grid, with each bit corresponding to a pixel to be drawn, although no color information is saved. This technique was used in early operating systems to store information on how to draw different characters in text mode, where each character was 8 bits wide and 8 bits high, translating into an 8-pixel square on the screen when drawn. Some applications still use a binary pattern to store icons, such as the shape of a mouse pointer.

Discuss this Article

Post your comments
Login:
Forgot password?
Register:
    • Man holding computer
      Man holding computer