← 返回命令列表

Linux command

pnmcolormap 命令

文本

涉及管道、覆盖或删除,执行前请先确认路径和参数。

常用示例

Generate color map with N colors

pnmcolormap [256] [image.ppm] > [colormap.ppm]

Use median cut algorithm

pnmcolormap -center [16] [image.ppm] > [colormap.ppm]

Spread colors evenly

pnmcolormap -spreadluminosity [256] [image.ppm] > [colormap.ppm]

From multiple images

pnmcolormap [256] [image1.ppm] [image2.ppm] > [colormap.ppm]

说明

pnmcolormap creates a color map (palette) from an image using median cut quantization. The output is a small image where each pixel is a color from the palette. Used with pnmremap for color reduction.

参数

ncolors
Maximum colors in map.
-center
Use center of cluster.
-meancolor
Use mean color of cluster.
-meanpixel
Use mean weighted by pixel count.
-spreadbrightness
Spread by brightness.
-spreadluminosity
Spread by luminosity.

FAQ

What is the pnmcolormap command used for?

pnmcolormap creates a color map (palette) from an image using median cut quantization. The output is a small image where each pixel is a color from the palette. Used with pnmremap for color reduction.

How do I run a basic pnmcolormap example?

Run `pnmcolormap [256] [image.ppm] > [colormap.ppm]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does ncolors do in pnmcolormap?

Maximum colors in map.