什么是 PGM?可移植灰度图格式解释
Netpbm 家族的灰度成员,存储简单的未压缩灰度图像。
最后更新:
What is it?
PGM, the Portable Graymap format, is the grayscale member of the Netpbm family of image formats developed by Jef Poskanzer. It extends the simple Netpbm design to store gray-level images where each pixel holds a single intensity value.
A PGM file begins with a magic number, P2 for the plain ASCII variant or P5 for the binary (raw) variant, followed by the width, height, and a maximum gray value, then the pixel data. The maximum value defines the white point and allows either 8-bit or 16-bit gray levels, with no compression applied.
Technical Specifications
Pros & Cons
Advantages
PGM cleanly represents gray-level images with a minimal, easy-to-parse structure.
The P2 ASCII form is human-readable, while the P5 raw form is more compact for the same image.
The maximum gray value field supports both 8-bit and 16-bit precision per pixel.
It is widely handled by image-processing toolkits and is easy to generate programmatically.
Disadvantages
PGM cannot store color; color images require the related PPM format.
Uncompressed storage makes files larger than compressed grayscale formats such as PNG.
The format carries only essential image dimensions and a max value, with no rich metadata support.
When to Use It
PGM is a convenient intermediate format for grayscale image processing.
计算机视觉输入
Many image-processing and vision tools accept PGM grayscale images for analysis.
Netpbm 转换
PGM serves as an intermediate when converting grayscale images between formats.
科学和深度数据
Single-channel intensity or height data can be stored straightforwardly as PGM.
如何打开 PGM 文件
用于处理 PGM 文件的软件可以分为专业工具、免费/开源应用程序、基于浏览器的解决方案和内置实用程序。专业工具适合需要高级功能和高保真的用户,而免费/开源选项则迎合那些优先考虑性价比和社区支持的用户。基于浏览器的解决方案提供了无需安装的便利性,而内置实用程序为休闲用户提供基本功能。
在选择 PGM 文件的软件时,功能保真度、是否专注于编辑或查看、成本模型和平台兼容性等因素至关重要。用户应考虑他们的导出需求,因为某些应用程序提供强大的转换选项,而其他应用程序可能有限。在某些情况下,将 PGM 文件转换为更广泛支持的格式可能是兼容性和易用性的更好选择。
GIMP 2.10.34
GIMP 是一个强大的开源图像编辑器,支持 PGM 文件的查看和编辑。它允许用户以高保真度操作灰度图像,适合详细的图形工作。
- 高级图层和蒙版编辑
- 可自定义的画笔和滤镜
- 支持高位深图像
- 批处理能力
- 广泛的插件支持
- 高度可自定义的界面和工具
- 强大的社区和支持资源
- 完整功能免费
- 初学者学习曲线较陡
- 处理大文件时性能可能滞后
可导出为: PNG, JPG, TIFF, BMP, GIF
适合: GIMP 非常适合需要全面编辑套件的 PGM 文件用户,且无需费用。
访问 GIMP →ImageMagick 7.1.0-16
ImageMagick 是一个命令行工具,擅长转换和操作图像,包括 PGM 文件。它特别适用于批处理和自动化图像任务。
- 用于自动化的命令行界面
- 多个文件的批量转换
- 广泛的格式支持和操作
- 图像调整和过滤选项
- 支持脚本和集成
- 强大的批处理任务能力
- 轻量快速的性能
- 高度灵活,支持脚本
- 没有图形用户界面
- 需要命令行知识
可导出为: PNG, JPG, TIFF, GIF, BMP
适合: ImageMagick 非常适合需要强大批处理和自动化 PGM 文件的高级用户。
访问 ImageMagick →IrfanView 4.60
IrfanView 是一个轻量级图像查看器,支持多种格式,包括 PGM。它旨在快速查看和基本编辑,使其对休闲用户友好。
- 快速图像查看和浏览
- 基本编辑工具,如裁剪和调整大小
- 幻灯片创建功能
- 支持插件以扩展功能
- 批量转换和重命名功能
- 极快且轻量
- 用户友好的界面,适合初学者
- 良好的批处理支持
- 高级编辑功能有限
- 仅限 Windows 平台
可导出为: PNG, JPG, BMP, TIFF, GIF
适合: IrfanView 适合需要快速和简单方式查看和进行基本编辑 PGM 文件的用户。
访问 IrfanView →Photoshop 2023
Adobe Photoshop 是领先的专业图像编辑软件,支持 PGM 文件。它提供广泛的编辑能力,适合高质量图像操作和设计工作。
- 全面的图层和蒙版编辑
- 高级颜色校正工具
- 支持 16 位和 32 位图像
- 广泛的滤镜和效果选项
- 与 Adobe Creative Cloud 的集成
- 行业标准的编辑工具
- 丰富的专业使用功能
- 与其他 Adobe 应用程序的无缝集成
- 订阅模型可能成本高
- 复杂性可能让新用户感到困惑
可导出为: PNG, JPG, TIFF, PSD, PDF
适合: Photoshop 非常适合需要高级编辑功能和高保真度的专业用户处理 PGM 文件。
访问 Photoshop →Convert PGM Files Free
Use our free online image converter to convert PGM and other formats - no signup, no watermarks.
Try Image Converter Free