User Rating 0.0 โ˜…โ˜…โ˜…โ˜…โ˜…
Total Usage 0 times
Drop an image here or click to browse PNG, JPG, BMP, GIF, WebP • Max 2048×2048
Is this tool helpful?

Your feedback helps us improve.

โ˜… โ˜… โ˜… โ˜… โ˜…

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.

bitmap to binary image binary converter pixel to binary binary art image to bits bitmap converter binary numbers

Formulas

Each pixel channel value c in the range [0, 255] is converted to an 8-bit binary string:

b = bin(c), padded to 8 digits

For grayscale mode, the luminance Y is computed using the ITU-R BT.709 standard coefficients before binary conversion:

Y = 0.2126 โ‹… R + 0.7152 โ‹… G + 0.0722 โ‹… B

For 1-bit threshold mode, each pixel is reduced to a single binary digit:

{
1 if Y โ‰ฅ T0 if Y < T

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:

L = w ร— h ร— bpp

Where bpp = bits per pixel (32 for RGBA, 24 for RGB, 8 for grayscale, 1 for threshold).

Reference Data

Output ModeBits per PixelChannels UsedTypical Use Case
Full RGBA32R, G, B, AComplete pixel data preservation
RGB Only24R, G, BColor data without transparency
Grayscale8Luminance (Y)Monochrome binary representation
1-Bit Threshold1Luminance vs thresholdBinary art, ASCII art source
Common Image Dimensions & Output Sizes (1-Bit Mode)
8ร—864 bitsSprite/icon tiles
16ร—16256 bitsFavicon, retro sprites
32ร—321,024 bitsSmall icons
64ร—644,096 bitsThumbnail analysis
100ร—10010,000 bitsSmall bitmap study
256ร—25665,536 bitsTexture analysis
512ร—512262,144 bitsMedium bitmap
1024ร—10241,048,576 bitsHigh-res analysis (slow output)
Bit Depth Reference
1-bit2 valuesBlack & white only
4-bit16 valuesEarly CGA/EGA graphics
8-bit256 values per channelStandard sRGB (this tool)
16-bit65,536 values per channelHDR / medical imaging
24-bit16,777,216 colors totalTrue Color (RGB)
32-bit4,294,967,296 valuesTrue Color + Alpha (RGBA)

Frequently Asked Questions

A simple average treats all channels equally: (R + G + B) รท 3. The ITU-R BT.709 formula weights green at 0.7152 because human vision is most sensitive to green wavelengths. A pure green pixel (0, 255, 0) yields luminance 182 with BT.709 but 85 with simple averaging. This difference changes threshold results significantly.
Threshold mode ignores the alpha channel entirely. It computes luminance from RGB values only. Fully transparent pixels (alpha = 0) still have RGB data stored in the bitmap, and those values are used. If you need transparency-aware conversion, use RGBA mode and inspect the alpha binary separately.
A 512ร—512 image in RGBA mode produces 8,388,608 binary digits. Rendering that much text in the DOM causes browser memory issues and potential tab crashes. The downsample option lets you reduce any image to a manageable size while preserving its visual structure through nearest-neighbor or bilinear interpolation.
This tool reads raw sRGB channel values as stored in the image file (gamma-encoded). It does not apply inverse gamma correction before binary conversion. The getImageData() Canvas API returns values in sRGB space. If you need linear-light binary values, you would need to apply the sRGB transfer function externally: clinear = ((csRGB + 0.055) รท 1.055)2.4 for values > 0.04045.
Yes, if you use RGB or RGBA mode without downsampling. Each pixel's channels map to sequential 8-bit groups. Parse the binary string row by row, split into 8-bit chunks, convert each to decimal (0-255), and reconstruct the pixel array. The original image dimensions are included in the output header. Threshold mode is lossy and cannot reconstruct the original.
This tool outputs standard big-endian binary (most significant bit first). A channel value of 200 outputs as 11001000, where the leftmost bit represents 27 = 128. Little-endian would reverse this to 00010011. Most binary data standards and network protocols use big-endian (network byte order).