Generate Random Bitmap
Create a random-pixel image up to 1024 × 1024 in black and white, grayscale, full colour or your own palette. Set the black-pixel density, use a seed for a repeatable image, and download a crisp PNG or a real 24-bit .bmp file at up to 32× scale.
Pixels from crypto.getRandomValues(), or a seeded generator
White Noise: Every Pixel on Its Own
Each pixel here is drawn independently of its neighbours, which makes the image white noise: the snow on an untuned analogue TV, or the grain test pattern used to check a display or an image pipeline. There are no shapes, gradients or edges on purpose; any clusters you see are chance.
That is different from the "noise" used for clouds, terrain and marble textures. Perlin, simplex and value noise blend random values smoothly across space, so neighbouring pixels are similar. If you want soft, organic texture, white noise is the wrong starting point; blurring it helps only a little.
In black-and-white mode, Black pixels (%) sets the density. At 50% you get static; at 5 to 10% you get scattered dots, the "salt and pepper" pattern used to test denoising filters. In My colours mode each colour is equally likely, so add a colour twice to make it twice as common.
Worked Example: 512 × 512 Noise That Won’t Compress
A developer needs a worst-case image to test an upload limit. A 512 × 512 photo is usually well under 100 KB as a JPEG, but a full-colour noise image of the same size can't be squeezed: every pixel carries 24 bits that nothing else predicts.
Step 1: Raw pixel data
Step 2: As a 24-bit BMP
Step 3: As a PNG
Random pixels are the largest an image of that size can be. The minimum depends only on how much randomness each pixel holds, so the colour mode decides it:
| Colour mode | Random bits per pixel | Smallest possible file data |
|---|---|---|
| Black and white, 50% | 1 | 32,768 bytes (32 KB) |
| My colours, 4 colours | 2 | 65,536 bytes (64 KB) |
| Grayscale | 8 | 262,144 bytes (256 KB) |
| Full colour | 24 | 786,432 bytes (768 KB) |
Browsers save canvas PNGs as full colour even when the image only has two colours, so the PNG of a black-and-white noise image is larger than this minimum. The PNG at 1× tile above shows the real size of the file your browser makes. The same 512 × 512 canvas filled with a single colour compresses to a few kilobytes.
PNG or BMP: Which Download?
"Bitmap" usually just means an image made of pixels, so for websites, documents and image editors, take the PNG. It is lossless, works everywhere and is never larger than it needs to be.
Take the BMP when something specifically asks for a .bmp file: older Windows software, some embedded displays and microcontroller libraries, or your own code, where an uncompressed format with a fixed header is easy to read byte by byte. Its size is predictable from the dimensions alone, as the tile above shows.
Avoid JPEG for noise. Lossy compression smears random pixels into blocks and ringing, and still produces a large file, so you lose the noise and gain nothing.
Inside the 24-bit BMP File
The BMP download is a 14-byte file header, a 40-byte BITMAPINFOHEADER, then the pixels. All numbers are little-endian.
| Byte offset | Field | Value written |
|---|---|---|
| 0 | Signature | "BM" |
| 2 | File size in bytes | 54 + row size × height |
| 10 | Offset to pixel data | 54 |
| 14 | Info header size | 40 |
| 18 / 22 | Width / height | Pixels; positive height = bottom-up |
| 28 | Bits per pixel | 24 |
| 30 | Compression | 0 (BI_RGB, none) |
| 38 / 42 | Resolution | 2,835 px/m (72 dpi) |
Two details trip up people who write their own BMP reader. Rows are stored bottom to top, and each pixel is stored as blue, green, red. And every row is padded to a multiple of 4 bytes: a 5-pixel-wide row holds 15 bytes of colour, so one zero byte is added to make 16. Widths that are a multiple of 4 need no padding.
Repeatable Noise With a Seed
Leave Seed empty and every image is new, drawn from your browser's secure random source. Type any text, such as test-001, and the page switches to a seeded generator (sfc32): the same seed, size and colour settings always produce exactly the same pixels, on any device.
That is useful when an image is a test fixture. You can regenerate the identical input for a resize or compression test instead of storing the file, compare a filter's output before and after a code change, or tell a colleague "seed test-001, 256 × 256, grayscale" instead of sending an attachment. Changing the size changes the image, because the pixels are read from the sequence row by row.
Seeded output is predictable by design, so don't use it where unpredictability matters. The seed is only used in your browser and is not part of the downloaded file.
Enlarging Pixels Without Blur
A 16 × 16 image is tiny on screen. Enlarging it with ordinary smooth resizing blends neighbouring pixels into a blur. To keep hard square edges, enlarge by a whole number using nearest-neighbour scaling, which is what Download scale does: 16 × 16 at 16× gives a 256 × 256 file where each original pixel is a 16 × 16 block.
- CSS:
image-rendering: pixelated;on theimgkeeps a small image sharp when the browser scales it up. - Photoshop: Image Size, resample with Nearest Neighbor (hard edges).
- GIMP: Scale Image with Interpolation set to None.
Whole-number scales matter. At 1.5× some pixels become two pixels wide and others one, which makes the grid look uneven.
Frequently asked questions
Is a random bitmap the same as a BMP file?
Not necessarily. Bitmap means any image stored as a grid of pixels. This page offers both a PNG and a true 24-bit .bmp file of the same pixels.
Will the noise tile seamlessly as a background?
Yes. Because every pixel is independent, there is no edge pattern to break, so copies placed side by side join without a visible seam. On a very large area the repeat of the whole tile can become noticeable.
Can I make a transparent noise image?
No, every pixel is fully opaque. Make the noise here, then lower its layer opacity or use a blend mode such as Overlay in an image editor to lay it over another picture as grain.
Why is the PNG of my black-and-white image so large?
Browsers save canvas images as full-colour PNGs, and random pixels compress poorly. Use the BMP if you need a predictable size, or convert to a 1-bit PNG in an image editor.
Sources
- Microsoft Learn: BITMAPFILEHEADER structure: the BM signature, file size and pixel-data offset.
- Microsoft Learn: BITMAPINFOHEADER structure: bottom-up rows, BI_RGB, and rows padded to 4-byte boundaries.
- W3C: Portable Network Graphics (PNG) Specification: lossless compression with per-row filters.
- MDN: HTMLCanvasElement.toBlob(): how the browser encodes the canvas as PNG.
- MDN: image-rendering: the pixelated value for sharp upscaling.
- MDN: Crypto.getRandomValues(): the secure random source used when no seed is given.
Related Tools
Create GUIDs for Microsoft and .NET fields.
Generate binary numbers with a chosen bit length.
Generate bytes in hex, Base64, or decimal format.
Pick a date between your chosen start and end dates.
Generate decimals with a chosen range and precision.
Generate fractions and see their simplified forms.