Linux command
pnmtopng 命令
文本
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Convert PNM to PNG
pnmtopng [input.pnm] > [output.png]
Convert with compression
pnmtopng -compression [9] [input.pnm] > [output.png]
Add alpha channel
pnmtopng -alpha [alpha.pgm] [input.ppm] > [output.png]
Create interlaced PNG
pnmtopng -interlace [input.pnm] > [output.png]
说明
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.
参数
- -alpha _file_
- Alpha channel file.
- -compression _n_
- Compression level (0-9).
- -interlace
- Create interlaced PNG.
- -transparent _color_
- Transparent color.
- -gamma _value_
- Gamma value.
FAQ
What is the pnmtopng command used for?
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.
How do I run a basic pnmtopng example?
Run `pnmtopng [input.pnm] > [output.png]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -alpha _file_ do in pnmtopng?
Alpha channel file.