4.4. 压缩图像

图 3.17. 用于JPEG保存的示例图像

用于JPEG保存的示例图像

如果您的图像占用了大量磁盘空间,即使不更改图像尺寸,您也可以减少该空间。最好的图像压缩是使用JPG格式实现的,但即使图像已经是这种格式,您通常仍然可以让它占用更少的空间,因为 JPG 格式具有自适应压缩方案,允许以不同级别保存压缩。需要权衡的是图像占用的空间越少,您丢失的原始图像的细节就越多。您还应该注意,以 JPG 格式重复保存会导致越来越多的图像质量下降。

图像被加载并保存为 .XCF 文件。您的 JPG 图像已作为 XCF 加载。GIMP为您提供覆盖 image-name.jpg文件导出为以打开导出图像对话框。

图 3.18. 导出图像对话框

“导出图像”对话框

The dialog opens with the file name already typed in the Name box, with the default .png extension. Delete the existing extension and type JPG instead, and GIMP will determine the file type from the file extension. Use the file extension list, marked with red in the figure above, to see the types supported by GIMP. The supported extensions change depending on your installed libraries. If GIMP complains, or if JPEG is disabled in the list of extensions, cancel and step through 第 4.7 节 “更改模式”. Once you have done this, click Export. This opens the Export Image as JPEG dialog that contains the Quality control.

导出图像为JPEG对话框使用默认值,在保持良好的视觉质量时,减小内存尺寸;这是最安全快捷的做法。

图 3.19. 中等 JPEG 压缩示例

中等 JPEG 压缩示例

Quality: 90 (default); Size: 33.7 KiloBytes

中等 JPEG 压缩示例

Quality: 75; Size: 20.1 KiloBytes


Reduce the image Quality to make the image even smaller. Reduced quality degrades the image, so be certain to check Show preview in image window to visually gauge the degradation. A Quality setting of 10 produces a very poor quality image that uses very little disk space. A quality of 75 produces a reasonable image using much less disk space, which will, in turn, load much faster on a web page. Although the image is somewhat degraded, it is acceptable for the intended purpose.

最后,这里是同一张图片不同压缩程度的对比:

图 3.20. 高 JPEG 压缩示例

高 JPEG 压缩示例

质量:10,大小:3.4 KB

高 JPEG 压缩示例

质量:40,大小:9.3 KB


图 3.21. 中等 JPEG 压缩示例

中等 JPEG 压缩示例

质量:70,大小:15.2 KB

中等 JPEG 压缩示例

质量:100,大小:72.6 KB