LinuxCommandLibrary

pnmtopng

Convert PNM images to PNG format

TLDR

Convert PNM to PNG

$ pnmtopng [input.pnm] > [output.png]
copy
Convert with compression
$ pnmtopng -compression [9] [input.pnm] > [output.png]
copy
Add alpha channel
$ pnmtopng -alpha [alpha.pgm] [input.ppm] > [output.png]
copy
Create interlaced PNG
$ pnmtopng -interlace [input.pnm] > [output.png]
copy

SYNOPSIS

pnmtopng [options] [file]

DESCRIPTION

pnmtopng converts PNM (PBM, PGM, PPM) images to PNG format with lossless compression. It automatically selects the optimal PNG color type based on the input image.
The -alpha option attaches a separate PGM file as an alpha transparency channel. The -compression level (0-9) controls the deflate compression effort, and -interlace creates Adam7 interlaced PNGs for progressive display. The -transparent option designates a specific color as fully transparent. Part of the Netpbm toolkit; superseded by pamtopng.

PARAMETERS

-alpha file

Alpha channel file.
-compression n
Compression level (0-9).
-interlace
Create interlaced PNG.
-transparent color
Transparent color.
-gamma value
Gamma value.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community