Generate Random Bitmap

Build a random pixel bitmap in the browser with secure randomness when available, preview it on a canvas, and export the result as a PNG.

`Monochrome` uses only black and white, `grayscale` uses one shared channel, and `rgb` generates full-color pixels.

How The Generator Works

The tool requests random bytes, maps them to pixel channels, and writes the result into `ImageData` before drawing it onto a canvas.

Monochrome mode turns each random byte into either black or white. Grayscale mode reuses one random channel for red, green, and blue. RGB mode assigns three random channels to every pixel.

The random-source byte count shows how many bytes were consumed to build the image, which is especially useful in monochrome mode where each displayed pixel ends up as only black or white.

Quick Examples

A 16 x 16 monochrome bitmap is useful for tiny procedural icon experiments.
A grayscale bitmap gives you random luminance values without color noise.
An RGB bitmap can create glitch-art textures, test fixtures, or placeholder sprites.
Larger scales make low-resolution pixel patterns easier to inspect on screen.

Frequently Asked Questions

What is a bitmap?

A bitmap is an image made from a grid of pixels, where each pixel stores color information directly.

Why export PNG instead of BMP?

PNG exports are natively supported by the browser canvas API and preserve the generated pixels cleanly.

Is the randomness secure?

The generator uses `crypto.getRandomValues()` when the browser provides it and falls back to `Math.random()` only when needed.

Can I use this for test assets?

Yes. Random bitmaps are useful for placeholder textures, rendering tests, and pixel-processing demos.

Useful Notes

Canvas rendering stays local in the browser, so no bitmap data needs to leave the page.

Small dimensions with a larger pixel scale are usually the easiest way to explore random pixel art patterns.

Changing the color mode alters how many random bytes are consumed for each pixel.

Related Tools