← 返回命令列表

Linux command

ppmtojpeg 命令

文本

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

常用示例

Convert PPM to JPEG

ppmtojpeg [input.ppm] > [output.jpg]

Convert with specific quality

ppmtojpeg -quality [90] [input.ppm] > [output.jpg]

Create a progressive JPEG

ppmtojpeg -progressive [input.ppm] > [output.jpg]

Convert with optimized Huffman encoding

ppmtojpeg -optimize [input.ppm] > [output.jpg]

Convert with grayscale output

ppmtojpeg -grayscale [input.ppm] > [output.jpg]

说明

ppmtojpeg converts PPM (Portable Pixel Map) images to JPEG/JFIF format. It is an alias for pnmtojpeg and is part of the Netpbm toolkit. The command reads from a file or stdin and writes JPEG data to stdout. The default quality of 75 provides a good balance between file size and visual quality. Values above 95 produce diminishing returns in quality while significantly increasing file size.

参数

-quality _n_
JPEG quality factor (0-100, default: 75). Higher values produce better quality but larger files.
-progressive
Create a progressive JPEG (loads in multiple passes).
-optimize
Optimize Huffman coding tables for smaller file size at the cost of slower compression.
-grayscale
Create a grayscale JPEG regardless of input color.
-density _DPI_
Set pixel density in dots per inch.
-smooth _n_
Smooth input image (1-100) to reduce dithering artifacts.

FAQ

What is the ppmtojpeg command used for?

ppmtojpeg converts PPM (Portable Pixel Map) images to JPEG/JFIF format. It is an alias for pnmtojpeg and is part of the Netpbm toolkit. The command reads from a file or stdin and writes JPEG data to stdout. The default quality of 75 provides a good balance between file size and visual quality. Values above 95 produce diminishing returns in quality while significantly increasing file size.

How do I run a basic ppmtojpeg example?

Run `ppmtojpeg [input.ppm] > [output.jpg]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -quality _n_ do in ppmtojpeg?

JPEG quality factor (0-100, default: 75). Higher values produce better quality but larger files.