Linux command
pnmremap 命令
文件
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Remap image to palette
pnmremap -mapfile=[palette.pnm] [input.pnm] > [output.pnm]
Use Floyd-Steinberg dithering
pnmremap -floyd -mapfile=[palette.pnm] [input.pnm] > [output.pnm]
No dithering
pnmremap -nofloyd -mapfile=[palette.pnm] [input.pnm] > [output.pnm]
说明
pnmremap replaces each pixel's color in a PNM image with the closest matching color from a specified palette image. This is useful for forcing an image to use only a specific set of colors, such as when targeting a limited-color display format. The -floyd option enables Floyd-Steinberg error diffusion dithering for smoother visual results. The palette is provided via -mapfile as a PNM image where each unique pixel color represents one allowed color. Part of the Netpbm toolkit.
参数
- -mapfile _FILE_
- Color palette image.
- -floyd
- Use Floyd-Steinberg dithering.
- -nofloyd
- No dithering.
- -norandom
- Disable random dithering.
- -firstisdefault
- Use first palette color as default.
FAQ
What is the pnmremap command used for?
pnmremap replaces each pixel's color in a PNM image with the closest matching color from a specified palette image. This is useful for forcing an image to use only a specific set of colors, such as when targeting a limited-color display format. The -floyd option enables Floyd-Steinberg error diffusion dithering for smoother visual results. The palette is provided via -mapfile as a PNM image where each unique pixel color represents one allowed color. Part of the Netpbm toolkit.
How do I run a basic pnmremap example?
Run `pnmremap -mapfile=[palette.pnm] [input.pnm] > [output.pnm]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -mapfile _FILE_ do in pnmremap?
Color palette image.