User Rating 0.0
Total Usage 0 times
1 – 4096
1 – 4096
0 – 4294967295
Pixel coloring algorithm
Mono/Gray: white pixel probability
Presets:
Is this tool helpful?

Your feedback helps us improve.

About

Random bitmap generation is fundamental to procedural texture synthesis, cryptographic visual hashing, and display calibration. A bitmap where each pixel's color is determined by a pseudo-random number generator (PRNG) with seed s produces a deterministic output: identical seeds yield identical images. This property is critical for reproducible test assets and stochastic simulations. The generator operates on raw pixel buffers of dimensions W × H, writing 4 bytes (RGBA) per pixel. Monochrome mode applies a density threshold d [0, 1] to control the ratio of black-to-white pixels. Without a seeded PRNG, generated textures cannot be version-controlled or shared between team members. This tool implements Mulberry32, a fast 32-bit PRNG with a period of 232, sufficient for bitmaps up to 4096 × 4096 without visible periodicity artifacts.

random bitmap pixel generator noise texture bitmap image random pixels texture generator png generator

Formulas

The Mulberry32 PRNG advances internal state s on each call and returns a normalized float in [0, 1):

s s + 0x6D2B79F5
t = (s &xor; (s >>> 15)) × (s | 1)
mulberry32(s) = ((t &xor; (t + (t &xor; (t >>> 7)) × 61)) >>> 0)4294967296

For monochrome mode with density d, a pixel is white if mulberry32(s) < d, black otherwise. Total pixel count N = W × H. Buffer size in bytes: B = 4 × N (RGBA bytes).

Where s = seed (unsigned 32-bit integer), t = intermediate hash value, W = bitmap width in px, H = bitmap height in px, d = density threshold (0 - 1), N = total pixel count, B = buffer size.

Reference Data

Color ModeChannels UsedBits Per PixelUnique ColorsTypical Use Case
Monochrome (1-bit)1 (threshold)12QR masks, dithering tests
Grayscale1 (luminance)8256Noise maps, heightfields
RGB Full3 (R, G, B)2416,777,216Test patterns, random art
RGBA Full4 (R, G, B, A)324,294,967,296Transparency stress tests
Custom Palette3 (mapped)242 - 16 (user)Game sprite textures, pixel art
Sepia Noise3 (weighted)24256 shadesVintage overlays, paper texture
Red Channel Only1 (R)8256Channel isolation testing
Blue Noise Approx.1 (spatial)8256Halftone, ordered dither
Binary Stripe1 (row parity)12Sync pattern, barcode tests
Pastel Random3 (high lum.)24~2,097,152Soft backgrounds, placeholder art
High Contrast3 (saturated)248 primaryAccessibility contrast tests
Gradient Noise1 (position-weighted)8256Fog maps, atmospheric effects

Frequently Asked Questions

The seed initializes the internal state of the Mulberry32 pseudo-random number generator. Because the algorithm is deterministic, identical initial state s produces an identical sequence of outputs. Changing the seed by even 1 produces a completely different bitmap due to avalanche properties of the hash mixing. This lets you share a seed value with colleagues to reproduce the exact same test texture.
Density d is a probability threshold between 0 and 1. For each pixel, the PRNG generates a value in [0, 1). If the value falls below d, the pixel is white; otherwise black. At d = 0.5, roughly half the pixels are white. At d = 0.1, roughly 10% are white, producing a sparse, mostly-dark bitmap.
The generator uses a Web Worker for bitmaps larger than 256 × 256. Bitmaps up to 2048 × 2048 (4,194,304 pixels, 16 MB buffer) generate in under 1 second on modern hardware. At 4096 × 4096 (16,777,216 pixels), expect 2 - 4 seconds. The canvas element itself may hit browser memory limits beyond 8192 px on mobile devices.
PNG uses lossless compression (deflate), producing smaller files ideal for web use. The exported PNG preserves exact pixel colors. BMP (Windows Bitmap) is uncompressed with a 54-byte BITMAPINFOHEADER, resulting in larger files but guaranteed compatibility with legacy software that cannot parse PNG chunks. BMP export constructs the binary header manually, writing pixels in bottom-up row order per the BMP specification.
No. The palette requires a minimum of 2 colors. With a single color, every pixel would be identical, producing a solid fill rather than a random bitmap. The generator validates palette entries and falls back to default black/white if fewer than 2 valid hex colors are provided. Maximum supported palette size is 16 colors.
Most image viewers apply bilinear or bicubic interpolation when scaling small images. A 64 × 64 bitmap displayed at 512 × 512 will appear blurred. To preserve crisp pixels, open the image in software that supports nearest-neighbor scaling, or use CSS image-rendering: pixelated. The preview canvas in this tool already applies nearest-neighbor interpolation.