Random Bitmap Generator
Generate random bitmap images with configurable size, color modes, density, and seeds. Export as PNG or BMP for textures, patterns, and testing.
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.
Formulas
The Mulberry32 PRNG advances internal state s on each call and returns a normalized float in [0, 1):
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 Mode | Channels Used | Bits Per Pixel | Unique Colors | Typical Use Case |
|---|---|---|---|---|
| Monochrome (1-bit) | 1 (threshold) | 1 | 2 | QR masks, dithering tests |
| Grayscale | 1 (luminance) | 8 | 256 | Noise maps, heightfields |
| RGB Full | 3 (R, G, B) | 24 | 16,777,216 | Test patterns, random art |
| RGBA Full | 4 (R, G, B, A) | 32 | 4,294,967,296 | Transparency stress tests |
| Custom Palette | 3 (mapped) | 24 | 2 - 16 (user) | Game sprite textures, pixel art |
| Sepia Noise | 3 (weighted) | 24 | 256 shades | Vintage overlays, paper texture |
| Red Channel Only | 1 (R) | 8 | 256 | Channel isolation testing |
| Blue Noise Approx. | 1 (spatial) | 8 | 256 | Halftone, ordered dither |
| Binary Stripe | 1 (row parity) | 1 | 2 | Sync pattern, barcode tests |
| Pastel Random | 3 (high lum.) | 24 | ~2,097,152 | Soft backgrounds, placeholder art |
| High Contrast | 3 (saturated) | 24 | 8 primary | Accessibility contrast tests |
| Gradient Noise | 1 (position-weighted) | 8 | 256 | Fog maps, atmospheric effects |