Bitwise

TD COMPs / TOPs / 2023 – Present

This collection of components focuses on bit‐level image processing operations. Rather than interpreting pixel values purely as continuous intensities or colors, these operators treat image data as binary information — allowing direct manipulation of the individual bits that compose each pixel value.

Bitwise operations form a low‐level computational layer beneath many image processing techniques. Shifting, masking, logical comparison, and binary pattern analysis can be used for tasks ranging from compact image analysis and texture classification to stylized digital artifacts and reduced‐precision aesthetics.

Unlike traditional arithmetic image operations, bitwise processes often produce abrupt structural changes in the binary representation of an image. This makes them useful both as analytical tools and as intentionally “digital” visual transformations that expose the discrete nature of image data itself.

Index:
Bitshift, Local Binary Pattern sit, Logic, NOT

Bitshift

Bitwise Shifting Operations

This component performs bitwise shift operations on the pixels of the input image. Rather than manipulating pixel values through traditional arithmetics, this Bitshift COMP operates directly on the binary representation of each pixel channel, shifting all bits either left or right by a user‐defined number of steps.

A left shift moves all bits toward more significant positions, effectively multiplying integer pixel values by powers of two, while a right shift moves bits toward less significant positions, reducing precision and dividing values by powers of two. Bits shifted beyond the available bit range are discarded, and newly introduced positions are filled with zeros.

Formally, for a pixel value Ι(ι):

Where n denotes the number of shift steps.

For example, given the 8‐bit binary value 00001000:

00001000 1 = 00010000 00001000 3 = 01000000 00001000 2 = 00000010

Because the operation is performed directly on binary data, the visual result depends heavily on the selected Bit Depth and pixel format. Small shifts may produce subtle quantization changes, while larger shifts can dramatically reduce or amplify tonal structure. This makes bitshifting useful both as a low‐level image processing utility and as a stylistic operation for creating posterization, digital corruption, or reduced‐precision aesthetics.

Resources:

Download the .tox files,
Bitwise Operations on Wikipedia,
Bit Shifting by Interview Cake,
Bitshifting by HIPR2

Parameters

Bit Depth:

Defines the pixel format and bit depth used during the bitshift operation.
Supported formats include:
8‐ or 16‐bit Fixed RGBA, Mono, RG, A, or Mono + Alpha.

Direction:

Determines whether the bits of each pixel are shifted left or right.

Steps:

Defines the number of bit positions to shift in the selected direction.

In‐ / Outputs

Input 0TOP image to be processed.

Output 0TOP bitshifted image.

Updated17/5/2026


Local Binary Pattern

Binary Texture Encoding

This component computes the Local Binary Pattern (LBP) of the input image — a texture descriptor that encodes the local spatial structure surrounding each pixel into a binary value. Rather than measuring intensity directly, the Local Binary Pattern operator analyzes how neighboring pixels relate to the center pixel, producing a compact representation of local texture.

For each pixel Ι(ι), the surrounding 3×3 neighborhood is evaluated. Neighboring pixels greater than or equal to the center pixel are assigned a binary value of 1, while neighboring pixels below the center pixel are assigned 0. These binary comparisons are then concatenated into an 8‐bit binary number describing the local texture pattern.

The resulting binary pattern encodes local image structures such as edges, corners, flat regions, and repetitive textures into a single scalar value. Similar local structures produce similar binary codes, making LBP a lightweight but effective descriptor for texture analysis and pattern recognition.

Because the operation compares neighboring pixels relationally rather than absolutely, Local Binary Patterns are relatively robust to global illumination changes while remaining computationally inexpensive. Beyond analytical use cases, the encoded binary structures can also produce distinctive stylized textures and procedural patterning effects.

Resources:

Download the .tox files,
Understanding the LBP on Medium,
LBPs on Wikipedia

Parameters

Channel:

Determines which image channel is used to compute the Local Binary Pattern:
Red, Green, Blue, or Alpha.

Edge Handling:

Defines how pixels along the image boundary are handled during Local Binary Pattern calculation.

In‐ / Outputs

Input 0TOP image to be processed.

Output 0TOP calculated LBP of the input image.

Updated17/5/2026


Logic

Bitwise Logical Operations

This component performs bitwise logical operations between two input images. Rather than combining pixels through arithmetic blending, the Logic COMP evaluates the binary representation of each pixel channel directly, applying logical comparisons bit‐by‐bit across the two inputs.

The selected Operand determines how corresponding bits from the two images interact:

  1. AND — active only when both bits are 1.
    For example:

    00001111 10101010 = 00001010


  2. NAND — inverse of AND.
    For example:

    00001111 10101010 = 11110101


  3. OR — active when either bit is 1.
    For example:

    00001111 10101010 = 10101111


  4. NOR — inverse of OR.
    For example:

    00001111 10101010 = 01010000


  5. XOR — active when bits differ.
    For example:

    00001111 10101010 = 10100101


  6. XNOR — active when bits are equal.
    For example:

    00001111 ⊽̲ 10101010 = 01011010


Because these operations occur directly on binary pixel data, the resulting images often exhibit abrupt structural transitions and reduced‐precision artifacts. Depending on the selected Bit Depth and pixel format, logical operations can preserve, suppress, isolate, or invert specific binary structures within the input images.

While bitwise logic is foundational to digital computation, applying these operations spatially to images produces a unique class of procedural transformations — useful for masking, binary pattern manipulation, digital compositing experiments, and intentionally computational aesthetics.

Resources:

Download the .tox files,
Logical Operations by HIPR2

Parameters

Bit Depth:

Defines the pixel format and bit depth used during the bitwise logic operation.
Supported formats include:
8‐ or 16‐bit Fixed RGBA, Mono, RG, A, or Mono + Alpha.

Operand:

Determines the bitwise logical operation performed between the two input images:
AND, OR, XOR, NAND, NOR, or XNOR.

In‐ / Outputs

Input 0TOP image to be processed.

Output 0TOP logically combined images.

Updated17/5/2026


NOT

Bitwise Inversion

This component performs a bitwise NOT operation on the input image. Rather than modifying pixel values through arithmetic inversion, the NOT COMP operates directly on the binary representation of each pixel channel, flipping every individual bit within the selected Bit Depth.

For each pixel value Ι(ι), every 0 bit becomes 1, and every 1 bit becomes 0. This produces the binary complement of the original image data.

For example, the NOT operation produces:

¬ 00001111 = 11110000 ¬ 10101010 = 01010101

Because the inversion occurs at the binary level, the resulting image differs from a traditional color inversion performed in normalized floating‐point space. The exact result depends on the selected Bit Depth and pixel format, as the operation inverts the underlying integer representation directly.

This makes the NOT operation useful both as a foundational logical operator and as a stylistic image transformation capable of producing harsh binary inversions, reduced‐precision artifacts, and computationally aesthetic image structures.

Resources:

Download the .tox files,
Logical NOT by HIPR2

Parameters

Bit Depth:

Defines the pixel format and bit depth used during the bitwise NOT operation.
Supported formats include:
8‐ or 16‐bit Fixed RGBA, Mono, RG, A, or Mono + Alpha.

In‐ / Outputs

Input 0TOP image to be processed.

Output 0TOP binary inverted image.

Updated17/5/2026