Linux command
ppmhist 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Show color histogram
ppmhist [input.ppm]
Show as map file
ppmhist -map [input.ppm]
Limit output colors
ppmhist -noheader [input.ppm] | head -20
说明
ppmhist reads a PPM (Portable Pixmap) image and prints a color histogram showing each distinct color and the number of pixels using it. It is part of the Netpbm toolkit and is useful for analyzing palette usage, identifying dominant colors, and preparing colormaps for quantization. By default the output is a sorted text table. With -map, the output is itself a valid PPM file representing the colormap, which can be fed to other Netpbm tools.
参数
- -map
- Output a colormap as a PPM file rather than a text table.
- -nomap
- Force text histogram output (the default).
- -noheader
- Omit the leading header line from text output.
- -sort _method_
- Sort entries by _frequency_ or _rgb_.
FAQ
What is the ppmhist command used for?
ppmhist reads a PPM (Portable Pixmap) image and prints a color histogram showing each distinct color and the number of pixels using it. It is part of the Netpbm toolkit and is useful for analyzing palette usage, identifying dominant colors, and preparing colormaps for quantization. By default the output is a sorted text table. With -map, the output is itself a valid PPM file representing the colormap, which can be fed to other Netpbm tools.
How do I run a basic ppmhist example?
Run `ppmhist [input.ppm]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -map do in ppmhist?
Output a colormap as a PPM file rather than a text table.