LinuxCommandLibrary

pgmnoise

creates a PGM image filled with random grayscale pixels

TLDR

Create white noise image
$ pgmnoise [100] [100] > [noise.pgm]
copy
Create large noise pattern
$ pgmnoise [1920] [1080] > [noise.pgm]
copy
Create and convert to PNG
$ pgmnoise [256] [256] | pnmtopng > [noise.png]
copy
With custom seed
$ pgmnoise -randomseed [12345] [100] [100] > [noise.pgm]
copy

SYNOPSIS

pgmnoise [options] width height

DESCRIPTION

pgmnoise creates a PGM image filled with random grayscale pixels (white noise). Each pixel is independently assigned a random gray value.
Useful for testing, creating textures, or generating random patterns.

PARAMETERS

width

Image width in pixels.
height
Image height in pixels.
-randomseed n
Seed for random number generator.
-maxval n
Maximum gray value.

Basic noise image

pgmnoise 512 512 > noise.pgm

Reproducible noise

pgmnoise -randomseed 42 100 100 > noise.pgm

Create texture and tile

pgmnoise 64 64 | pnmtile 256 256 > texture.pgm

Convert to PNG

pgmnoise 200 200 | pnmtopng > noise.png

$
# CAVEATS

Uniform distribution. For other noise types, combine with other tools. Part of Netpbm.

# HISTORY

pgmnoise is part of **Netpbm** by **Jef Poskanzer** and contributors, providing basic noise generation.

# SEE ALSO

pnmnoise(1), pgmmake(1), ppmforge(1), netpbm(1)
copy

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard