LinuxCommandLibrary

pgmmake

creates a solid color PGM grayscale image of specified dimensions

TLDR

Create solid gray image

$ pgmmake [0.5] [100] [100] > [gray.pgm]
copy
Create white image
$ pgmmake 1.0 [200] [150] > [white.pgm]
copy
Create black image
$ pgmmake 0.0 [640] [480] > [black.pgm]
copy
Specify max value
$ pgmmake -maxval [65535] [0.5] [100] [100] > [gray16.pgm]
copy

SYNOPSIS

pgmmake [options] grayval width height

DESCRIPTION

pgmmake creates a solid color PGM grayscale image of specified dimensions. The gray value is a fraction where 0.0 is black and 1.0 is white.

PARAMETERS

grayval

Gray level (0.0 = black, 1.0 = white).
width
Image width in pixels.
height
Image height in pixels.
-maxval n
Maximum gray value (default 255).

50% gray 100x100 image

pgmmake 0.5 100 100 > gray.pgm

Black background

pgmmake 0 1920 1080 > black.pgm

16-bit white image

pgmmake -maxval 65535 1.0 100 100 > white16.pgm

Create and convert to PNG

pgmmake 0.75 200 200 | pnmtopng > gray.png

$
# CAVEATS

Creates grayscale only. For color use ppmmake. Part of Netpbm toolkit.

# HISTORY

pgmmake is part of **Netpbm**, the image manipulation toolkit originally created by **Jef Poskanzer**.

# SEE ALSO

ppmmake(1), pbmmake(1), pnmtopng(1), netpbm(1)
copy

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community