Bytes to PNG Converter
Convert raw bytes (hex, decimal, base64, binary files) to PNG images. Visualize binary data as pixels with grayscale, RGB, or RGBA color modes.
About
Raw binary data has no inherent visual form. This tool maps byte sequences directly to pixel values on a canvas, then exports the result as a lossless PNG file. In grayscale mode, each byte (0 - 255) becomes one pixelβs luminance. In RGB mode, every 3 consecutive bytes define one pixelβs red, green, and blue channels. RGBA requires 4 bytes per pixel, adding an alpha (transparency) channel. The image width is either auto-calculated as the nearest integer square root or set manually; height is derived as h = ceil(N Γ· w), where N is total pixel count and w is width.
Forensic analysts use byte-to-image visualization to detect patterns in firmware, encrypted payloads, and file entropy. A region of uniform color indicates low entropy (compressed or zeroed data). High-frequency noise suggests encryption or randomness. Incorrect color mode selection will shift pixel alignment and produce a skewed image. This tool accepts hex strings, comma-separated decimals, base64-encoded data, and raw binary files up to 10 MB. Output PNG uses lossless compression, preserving every byteβs exact value for round-trip fidelity.
Formulas
Pixel count N depends on byte count B and bytes-per-pixel bpp:
Where bpp = 1 for grayscale, 3 for RGB, 4 for RGBA.
Auto-width calculation uses the integer square root:
Image height derived from width:
For grayscale-to-RGBA canvas mapping, each byte v at index i maps to 4 canvas bytes:
For RGB mode, bytes at positions 3i, 3i+1, 3i+2 map to R, G, B channels with alpha fixed at 255. RGBA mode maps 4 consecutive bytes directly to the canvas ImageData buffer.
Variable legend: B = total input byte count, bpp = bytes per pixel, N = total pixel count, w = image width in pixels, h = image height in pixels, v = byte value (0 - 255), i = pixel index, data = canvas RGBA pixel buffer.
Reference Data
| Color Mode | Bytes per Pixel | Channels | Use Case | Max Pixels from 1 KB |
|---|---|---|---|---|
| Grayscale | 1 | Luminance | Entropy visualization, firmware analysis | 1024 |
| RGB | 3 | R, G, B | Color data mapping, art generation | 341 |
| RGBA | 4 | R, G, B, A | Transparency data, icon extraction | 256 |
| Input Format | Example | Encoding | Typical Source |
|---|---|---|---|
| Hex String | FF00A3B2 | Base-16 pairs | Hex editors, memory dumps |
| Decimal CSV | 255,0,163,178 | Base-10 values | Sensor data, serial output |
| Base64 | /wCjsg== | 6-bit ASCII groups | Web APIs, email attachments |
| Binary File | (raw bytes) | 8-bit octets | Firmware, executables, images |
| Byte Value (Decimal) | Hex | Grayscale Appearance | Binary |
|---|---|---|---|
| 0 | 00 | Black | 00000000 |
| 32 | 20 | Very dark gray | 00100000 |
| 64 | 40 | Dark gray | 01000000 |
| 96 | 60 | Medium dark gray | 01100000 |
| 128 | 80 | Medium gray | 10000000 |
| 160 | A0 | Medium light gray | 10100000 |
| 192 | C0 | Light gray | 11000000 |
| 224 | E0 | Very light gray | 11100000 |
| 255 | FF | White | 11111111 |