Linux command
ppmtoascii 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Convert PPM to ASCII art
ppmtoascii [input.ppm]
Convert with 2x4 cell size
ppmtoascii -2x4 [input.ppm]
说明
ppmtoascii reads a PPM image and produces a somewhat crude ASCII graphic as output, with ANSI terminal control characters so it has crude color when sent to a color text terminal. Part of the Netpbm toolkit. In addition to the resolution options, ppmtoascii supports the common Netpbm options such as -quiet to suppress informational messages. Note that ppmtoterm does a similar conversion but displays each character as a single pixel (using the same dense character for every pixel), whereas ppmtoascii combines 2 or 8 pixels into one character that roughly represents those pixels.
参数
- -1x2
- Each character represents 1 pixel across by 2 pixels down. This is the default.
- -2x4
- Each character represents 2 pixels across by 4 pixels down, giving more detail.
FAQ
What is the ppmtoascii command used for?
ppmtoascii reads a PPM image and produces a somewhat crude ASCII graphic as output, with ANSI terminal control characters so it has crude color when sent to a color text terminal. Part of the Netpbm toolkit. In addition to the resolution options, ppmtoascii supports the common Netpbm options such as -quiet to suppress informational messages. Note that ppmtoterm does a similar conversion but displays each character as a single pixel (using the same dense character for every pixel), whereas ppmtoascii combines 2 or 8 pixels into one character that roughly represents those pixels.
How do I run a basic ppmtoascii example?
Run `ppmtoascii [input.ppm]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -1x2 do in ppmtoascii?
Each character represents 1 pixel across by 2 pixels down. This is the default.