图像格式¶
简介¶
digiKam 依赖于一些库和支持包来加载和保存图像格式。哪些图像格式能够支持,取决于这些库在你的系统上能不能用,在某些情况下,则取决于这些库的编译方式。大多数的发行版本中,digiKam 的图片查看都支持海量格式。
对第三方库的依赖意味着,无法给出一个明确清单,列好在你的系统上支持的所有格式。至少JPEG、PNG 和 TIFF 应该是可用的。
digiKam 只会显示它“认识”的文件格式。具体来说,它会查看文件的扩展名,然后与预设的文件类型列表进行比对。如果扩展名在列表中,并且你已经安装了对应的库,digiKam 就会在图像视图中显示这些文件。你也可以手动修改这个扩展名列表,具体方法请参见 相关的配置章节 。
几乎所有数码相机都会以两种格式之一来保存照片:JPEG 或 RAW。很多相机允许你选择使用哪一种格式。digiKam 支持这两种格式。关于它们的完整介绍,可以参考 维基百科上的内容 。
静态图像压缩格式¶
图像压缩是指将数据压缩算法应用于数字图像。其目的是减少图像中的冗余信息,以便更高效地存储或传输图像数据。
图像压缩可以分为有损压缩(lossy)和无损压缩(lossless)两种方式。无损压缩不会丢失原始数据,特别适合在裁剪、缩放、颜色校正等操作之前使用,因此在归档保存时更为理想。而有损压缩则会在压缩过程中引入一些“压缩痕迹”,尤其是在压缩比很高时。不过有损压缩非常适合日常使用,比如将图片发布到网上,因为文件更小,即便稍微降低一点画质也没关系。
JPEG¶
JPEG (Joint Photographic Experts Group,联合图像专家组)格式,是一种压缩格式,通过牺牲一部分图像质量来换取更小的文件大小。大多数相机默认都会使用这种格式保存照片,除非你手动修改设置。JPEG 是一种有损压缩格式,你可以根据需要调整压缩率,从而在图像质量和文件大小之间做权衡。许多相机会提供比如“好”、“更好”、“最好”这类选项(具体名称因品牌而异)。
JPEG 2000¶
JPEG 2000 is an improvement intended to replace the older JPEG standard that was introduced in 2000. It provides for the same compression ratio with better (smoother) results compared to JPEG. The 2000 version also supports lossless images, additional metadata tags, and 12-bit color depth.
TIFF¶
Tagged Image File Format has been widely accepted and widely supported as an image format. Commonly, TIFF may be stored by the camera in uncompressed form or using a lossless compression algorithm (Deflate). It maintains higher image quality but at the expense of much larger file sizes. Some cameras let you save your images in this format, and it is a popular format because of it is a lossless compression algorithm. The problem is that the format has been altered by so many people that there are now 50 or more flavors and not all are recognizable by most programs.
PNG¶
Portable Network Graphics is an image format that was developed in the 1990’s as a patent-free replacement for the older GIF image file format. It is a lossless format like TIFF but is much more compact, saving disk space. Although your camera is unlikely to support PNG, some people like to convert their photographs to PNG as soon as they get them on their computer. Unlike JPEG, PNG images do not lose quality every time you re-encode them after modification. digiKam fully supports PNG images and the Batch Queue Manager can convert a batch of images from any supported format to PNG (and other formats) in one step.
PNG 设计用于网页浏览环境,支持渐进式显示,也能保存 gamma 和色度信息,以便在不同设备上进行更好的颜色匹配。PNG 支持每像素每种颜色 8 位或 16 位的色深,是很理想的图像归档格式。
PGF¶
Progressive Graphics File is another not so well known, but open file image format. Wavelet-based, it allows lossless and lossy data compression. PGF compares well with JPEG 2000 but it was developed for speed (compression/decompression) rather than to be the best at compression ratio. At the same file size a PGF file looks significantly better than a JPEG file, while also remaining very good at progressive display. Thus it should be well-suited for photo archiving. digiKam uses this format to store thumbnails in its internal database.
WEBP¶
WebP (Web Photo)是由 Google 开发的 Web 图像格式,旨在替代 JPEG、PNG 和 GIF。它支持有损和无损压缩,同时还支持动画和透明通道。WEBP 也支持元数据,但色深最多为 8 位。自 2010 年推出以来,它以更小的文件体积实现了与 JPEG 相当的画质。
HEIF¶
HEIF (High Efficiency Image File Format,高效图像文件格式),是一种图像容器格式,发布于 2015 年,可用于存储单张图片或图像序列。它也支持包含字幕、音频和视频等媒体内容。HEIF 可存储多种编码格式的图像,例如 SDR 和 HDR。默认的图像编码器为 HEVC,因此这种格式也常被称为 HEIC。HEIF 图像在相同画质下比 JPEG 占用更少空间,支持 12 位色深和元数据。Apple 从 2017 年起开始在其设备上使用 HEIF 格式存图。
AVIF¶
AV1 Image File Format is an open, royalty-free image file format specification introduced in 2019 for storing images or image sequences compressed with AV1 in the HEIF container format. It competes with HEIC, which uses the same container format built upon the ISO base media file format (ISOBMFF) but uses HEVC for compression. AVIF showed better compression efficiency than JPEG as well as better detail preservation, fewer blocking artifacts and less color bleeding around hard edges in composites of natural images, text, and graphics. AVIF supports 12-bit color depth and metadata.
JXL¶
JPEG XL 是一种免版权费的栅格图像格式,支持有损和无损压缩。它的目标是全面超越现有图像格式,成为通用替代方案。
JXL 针对现代网页环境进行了优化,适配各种设备,同时具备与旧版 JPEG 格式平滑过渡的功能。JXL 于 2020 年底推出,支持 16 位色深和元数据。
备注
digiKam 支持的所有静态图像格式由 图像加载插件(Image Loader Plugins) 提供支持。你可以在“设置”或“首选项”对话框的 插件 - 图像加载程序 选项卡中查看可用插件列表。

“配置 digiKam 对话框”中的图像加载程序列表¶
RAW¶
有些相对高端的相机会允许用户将照片保存为 RAW 格式。严格来说,RAW 并不是一种统一的标准格式,不同品牌的相机有各自的 RAW 格式。RAW 图像保存的是相机感光元件捕捉到的原始数据,尚未经过机内白平衡、降噪、锐化等处理。因此,使用 RAW 格式可以在拍照后自由调整设置,比如白平衡,这也正是多数专业摄影师喜欢使用 RAW 的原因。不过,RAW 文件通常体积较大。
如果你想深入了解 RAW 格式,可以参考这几个非常有用的网站: 维基百科 和 剑桥色彩摄影学习社区 。你也可以使用 digiKam 的 图像编辑器 或 批处理管理器 将 RAW 格式的图像转换成 JPEG、PNG 或 TIFF 格式。
digiKam 通过内置的 Libraw 库 支持加载超过 1000 种不同类型的 RAW 文件格式,下面的表格列出了一部分支持的相机 RAW 格式。
RAW 文件格式 |
描述 |
---|---|
CRW, CR2, CR3 |
佳能(Canon)相机的 RAW 文件格式 |
NEF, NRW |
尼康(Nikon)相机的 RAW 文件格式 |
ORF, ORI |
奥林巴斯/奥之心(Olympus)相机的 RAW 文件格式 |
RAF |
富士(Fuji)相机的 RAW 文件格式 |
RWL |
徕卡(Leica)相机的 RAW 文件格式 |
PEF, PTX |
宾得(Pentax)相机的 RAW 文件格式 |
X3F |
适马(Sigma)相机的 RAW 文件格式 |
DCR, KDC, DC2, K25 |
柯达(Kodak)相机的 RAW 文件格式 |
SRF, SR2, ARW, MRW, MDC |
索尼(Sony)/美能达(Minolta)相机的 RAW 文件格式 |
RAW |
松下(Panasonic),卡西欧(Casio),徕卡(Leica)相机的 RAW 文件格式 |
DNG (CS1, HDR) |
Adobe 的 RAW 文件格式(数字负片),Apple ProRAW 文件 |
BAY |
卡西欧(Casio)的 RAW 文件(拜耳阵列) |
ERF |
爱普生(Epson)相机的 RAW 文件格式 |
FFF, 3FR |
易迈康(Imacon)/ 哈苏(Hasselblad)的 RAW 文件格式 |
RW2 |
松下(Panasonic)的 RAW 文件 |
IIQ, CAP |
飞思(Phase One)相机的 RAW 文件格式 |
RDC |
理光(Ricoh)的 RAW 文件 |
如果想知道 digiKam 是否支持您相机的 RAW 文件,请到 digiKam 程序中的
菜单对话框了解详情。
digiKam 支持的 RAW 格式一览表¶
其他格式¶
如果 digiKam 的其他模块无法加载某些较冷门的图像格式,它会借助 ImageMagick 提供支持。例如用于天文摄影的 FITS 格式、JBIG、PhotoCD、FLIF、BPG 等文件类型。
备注
我们也推荐你阅读本手册中 数字资产管理部分 部分的章节,了解 长期图像存档 时应使用的文件格式。