Linux command
pgmtopbm 命令
文本
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Convert grayscale to bitmap using default Floyd-Steinberg dithering
pgmtopbm [input.pgm] > [output.pbm]
Convert with explicit Floyd-Steinberg dithering
pgmtopbm -fs [input.pgm] > [output.pbm]
Convert with simple threshold
pgmtopbm -threshold -value [0.5] [input.pgm] > [output.pbm]
Convert with clustered dithering
pgmtopbm -cluster3 [input.pgm] > [output.pbm]
说明
pgmtopbm converts PGM grayscale images to PBM bitmap format. It uses dithering or thresholding to create 1-bit output from grayscale input. Part of the Netpbm toolkit. This tool is largely obsolete since Netpbm 10.23 (July 2004); pamditherbw(1) is the recommended replacement with better gamma handling.
参数
- -floyd, -fs
- Floyd-Steinberg dithering (default).
- -threshold
- Simple threshold conversion. Pixels above the threshold become white; below become black.
- -value _val_
- Threshold value between 0.0 and 1.0. Default is 0.5. Used with -threshold.
- -hilbert
- Hilbert curve dithering.
- -dither8, -d8
- Ordered dithering using an 8x8 matrix.
- -cluster3, -c3
- Clustered dithering using a 3x3 pattern.
- -cluster4, -c4
- Clustered dithering using a 4x4 pattern.
- -cluster8, -c8
- Clustered dithering using an 8x8 pattern.
- -clump _size_
- Clump size for Hilbert curve dithering.
- -randomseed _integer_
- Seed for randomization to produce reproducible results.
FAQ
What is the pgmtopbm command used for?
pgmtopbm converts PGM grayscale images to PBM bitmap format. It uses dithering or thresholding to create 1-bit output from grayscale input. Part of the Netpbm toolkit. This tool is largely obsolete since Netpbm 10.23 (July 2004); pamditherbw(1) is the recommended replacement with better gamma handling.
How do I run a basic pgmtopbm example?
Run `pgmtopbm [input.pgm] > [output.pbm]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -floyd, -fs do in pgmtopbm?
Floyd-Steinberg dithering (default).