As discussed last month, the JPEG save dialog will now help you to pick more appropriate quality settings if your image was originally loaded from a JPEG file. Two weeks ago, I modified the jpeg plug-in so that it detects and saves the quality settings when loading a JPEG image. This includes the overall quality level, the subsampling parameters and the quantization tables if they are different from the ones that can be generated by the IJG JPEG library. The quality level and subsampling parameters of the original image will be used as initial values when saving the image if they are better than your default settings.
Since Friday, I added a new option to the JPEG save dialog: "Use custom quality settings". If some quantization tables were attached to the image when it was loaded, then this option allows you to use them instead of the standard ones (different quantization tables are generated by the IJG JPEG library for each quality level). If you have only made a few changes to the image, then re-using the same quantization tables will give you almost the same quality and file size are the original image. This will minimize the losses caused by the quantization step, compared to what would happen if you used different quantization tables. The following table shows several examples of JPEG files that I re-saved using three different settings: - default GIMP settings (quality 85, chroma subsampling 2x2), - similar quality and sampling parameters (detected from original), - with new option "custom quality settings" (re-use quant. tables) The colums in the table show the mean difference in value for all pixels of the image, the maximum difference in value, the size of the DCT compressed data saved on disk (excluding comments, thumbnail and metadata) and the relative difference in size. Mean diff. Max diff. Size on disk Nikon D70 (Fine) - 3008x2000 2521329 - Default 2.1 21 575341 -77% - Quality 98, sampling 2x1 0.6 6 2377909 -6% - Custom quantization tables 0.2 5 2471203 -2% Nikon D70 (Normal0 - 3008x2000 3394771 - Default 3.6 31 1301350 -62% - Quality 97, sampling 2x1 0.4 10 3256047 -4% - Custom quantization tables 0.4 10 3255992 -4% Canon G5is (Superfine) - 3264x2448 2985249 - Default 2.9 39 899083 -70% - Quality 95, sampling 2x1 1.4 14 2373022 -21% - Custom quantization tables 0.3 11 2949326 -1% Sony DSC-D700 (Fine) - 1344x1024 676492 - Default 3.3 61 175496 -74% - Quality 97, sampling 2x1 1.4 18 603643 -11% - Custom quantization tables 0.5 17 636818 -6% Photoshop (Save for web 100%) - 500x333 112425 - Default 3.2 45 32624 -71% - Quality 98, sampling 1x1 0.9 7 110693 -1% - Custom quantization tables 0.2 5 121285 +7% Photoshop (Save for web 3%) - 921x921 102471 - Default 0.6 15 173831 +70% - Quality 45, sampling 2x2 2.5 17 138955 +35% - Custom quantization tables 0.0 9 112797 +10% SonyEricsson K750i (Fine) - 1632x1224 510916 - Default 3.9 36 539013 +5% - Quality 76, sampling 2x1 0.7 35 507275 -1% - Custom quantization tables 0.1 28 507543 -1% These examples show that re-using the same quantization tables as the original image minimizes the differences in the image and produces almost the same file size. Editing images in a lossy format such as JPEG is not recommended, but at least this new feature allows you to minimize the quality degradation in case your source images are not availabe in a lossless format. As far as I know, this ability to re-use custom quantization tables is unique to GIMP. Even Photoshop does not allow you to do that easily. Some command-line programs such as IJG's cjpeg allow you to supply your own quantization tables, but this is not as convenient. -Raphaël _______________________________________________ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer