← 返回命令列表

Linux command

pnmtojpeg 命令

文本

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

常用示例

Convert PNM to JPEG

pnmtojpeg [input.pnm] > [output.jpg]

Convert with quality

pnmtojpeg -quality [85] [input.pnm] > [output.jpg]

Create progressive JPEG

pnmtojpeg -progressive [input.pnm] > [output.jpg]

Optimize Huffman tables

pnmtojpeg -optimize [input.pnm] > [output.jpg]

说明

pnmtojpeg converts PNM (PBM, PGM, PPM) images to JPEG/JFIF format. The -quality option controls the compression-to-quality tradeoff, with higher values producing larger files with better image quality. The -progressive option creates progressive JPEGs that render in increasing detail during loading. The -optimize flag reduces file size by computing optimal Huffman coding tables. The -grayscale option forces single-channel output even for color inputs. Part of the Netpbm toolkit.

参数

-quality _n_
Quality (0-100, default 75).
-progressive
Create progressive JPEG.
-optimize
Optimize Huffman tables.
-grayscale
Force grayscale output.
-baseline
Force baseline JPEG.

FAQ

What is the pnmtojpeg command used for?

pnmtojpeg converts PNM (PBM, PGM, PPM) images to JPEG/JFIF format. The -quality option controls the compression-to-quality tradeoff, with higher values producing larger files with better image quality. The -progressive option creates progressive JPEGs that render in increasing detail during loading. The -optimize flag reduces file size by computing optimal Huffman coding tables. The -grayscale option forces single-channel output even for color inputs. Part of the Netpbm toolkit.

How do I run a basic pnmtojpeg example?

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

What does -quality _n_ do in pnmtojpeg?

Quality (0-100, default 75).