Bitmap to Binary Numbers Converter
Convert bitmap images to binary numbers. Extract pixel data as 8-bit binary per channel, grayscale binary, or 1-bit threshold output.
About
Every raster image is a grid of pixels. Each pixel stores color as numeric channel values in the range 0 - 255. This tool reads those values and converts each one to its 8-bit binary equivalent. A red channel value of 200 becomes 11001000. A threshold mode reduces each pixel to a single bit: 1 or 0, using the ITU-R BT.709 luminance model Y = 0.2126R + 0.7152G + 0.0722B. Misinterpreting channel order (RGB vs BGR) or ignoring gamma correction leads to corrupted binary representations. This converter handles standard sRGB images and lets you downsample before conversion to keep output manageable.
The tool processes images entirely in your browser using the Canvas API. No data leaves your device. Output formats include full RGBA binary (32 bits per pixel), grayscale binary (8 bits per pixel), and 1-bit threshold. For an image of w ร h pixels in full RGBA mode, the output contains w ร h ร 32 binary digits. Downsample aggressively for large images. A 100ร100 image at full RGBA already produces 320,000 bits of output.
Formulas
Each pixel channel value c in the range [0, 255] is converted to an 8-bit binary string:
For grayscale mode, the luminance Y is computed using the ITU-R BT.709 standard coefficients before binary conversion:
For 1-bit threshold mode, each pixel is reduced to a single binary digit:
Where T is the user-defined threshold (default 128). Full RGBA mode concatenates four 8-bit values per pixel: bin(R) + bin(G) + bin(B) + bin(A), yielding 32 bits per pixel. The total output length for an image of dimensions w ร h is:
Where bpp = bits per pixel (32 for RGBA, 24 for RGB, 8 for grayscale, 1 for threshold).
Reference Data
| Output Mode | Bits per Pixel | Channels Used | Typical Use Case |
|---|---|---|---|
| Full RGBA | 32 | R, G, B, A | Complete pixel data preservation |
| RGB Only | 24 | R, G, B | Color data without transparency |
| Grayscale | 8 | Luminance (Y) | Monochrome binary representation |
| 1-Bit Threshold | 1 | Luminance vs threshold | Binary art, ASCII art source |
| Common Image Dimensions & Output Sizes (1-Bit Mode) | |||
| 8ร8 | 64 bits | Sprite/icon tiles | |
| 16ร16 | 256 bits | Favicon, retro sprites | |
| 32ร32 | 1,024 bits | Small icons | |
| 64ร64 | 4,096 bits | Thumbnail analysis | |
| 100ร100 | 10,000 bits | Small bitmap study | |
| 256ร256 | 65,536 bits | Texture analysis | |
| 512ร512 | 262,144 bits | Medium bitmap | |
| 1024ร1024 | 1,048,576 bits | High-res analysis (slow output) | |
| Bit Depth Reference | |||
| 1-bit | 2 values | Black & white only | |
| 4-bit | 16 values | Early CGA/EGA graphics | |
| 8-bit | 256 values per channel | Standard sRGB (this tool) | |
| 16-bit | 65,536 values per channel | HDR / medical imaging | |
| 24-bit | 16,777,216 colors total | True Color (RGB) | |
| 32-bit | 4,294,967,296 values | True Color + Alpha (RGBA) | |