Linux command
pgmnoise 命令
文本
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Create a 100x100 white noise image
pgmnoise [100] [100] > [noise.pgm]
Create a full HD noise image
pgmnoise [1920] [1080] > [noise.pgm]
Create noise and convert to PNG
pgmnoise [256] [256] | pnmtopng > [noise.png]
Create reproducible noise with a fixed seed
pgmnoise -randomseed [12345] [100] [100] > [noise.pgm]
Create a small noise tile and repeat it
pgmnoise [64] [64] | pnmtile [256] [256] > [texture.pgm]
说明
pgmnoise creates a portable graymap (PGM) image where each pixel is independently assigned a uniformly distributed random gray value between 0 and the maximum value. The output is written to standard output in PGM format. The tool is useful for testing image processing pipelines, creating noise textures, or generating random patterns that can be piped into other Netpbm tools.
参数
- -randomseed _n_
- Seed for the random number generator, allowing reproducible output.
- -maxval _n_
- Maximum gray value for pixels. Defaults to the PGM compile-time maximum (typically 255 or 65535).
FAQ
What is the pgmnoise command used for?
pgmnoise creates a portable graymap (PGM) image where each pixel is independently assigned a uniformly distributed random gray value between 0 and the maximum value. The output is written to standard output in PGM format. The tool is useful for testing image processing pipelines, creating noise textures, or generating random patterns that can be piped into other Netpbm tools.
How do I run a basic pgmnoise example?
Run `pgmnoise [100] [100] > [noise.pgm]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -randomseed _n_ do in pgmnoise?
Seed for the random number generator, allowing reproducible output.