Version: 0.9.0-svn (using KDE 3.5.3, Debian Package 4:3.5.3-1 (testing/unstable)) Compiler: Target: i486-linux-gnu OS: Linux (i686) release 2.6.15-1-686-smp More control options for jpeg creation. Example, the 'advanced' save option for gimp 2.2 allows control for Optimize, Smoothing, Progressive, use restart markers, force baseline jpeg, Sub sampling, DCT method, and editable comment field. I am really interested in having easy control over Subsampling. This option was originally in jpeg to help further compress large files by averaging out similar colors, in able to reduce the jpeg file size. The default value for libjpeg is 2x2, 1x1, 1,1 . Digikam currently does not set this option, and therefore uses this default. Breifly, this default option throws away half of the color information, perhaps great for vidio compression, but not for todays high-quality color photography. For those who might be impatient as I was, you can quickly add the following to graphics/digikam/libs/dimg/loaders/jpegloader.cpp around line #485, after the line: jpeg_set_defaults(&cinfo); to set the subsampling to not compress as much. cinfo.comp_info[0].h_samp_factor = cinfo.comp_info[0].v_samp_factor = 1; This will give much larger jpeg's as the color information is not as compressed. references: http://jpegclub.org/foveon/index2.html http://www.wfu.edu/~matthews/misc/jpg_vs_gif/JpgCompTest/JpgChromaSub.html file:///usr/share/doc/libjpeg62-dev/libjpeg.doc thanks for considering.
I'm agree with you. The image quality must be preserved when it possible. There is already a file in B.K.O to move the IO file writting setting from setup to the saveas dialog (like Gimp and photoshop do). Look #123649. We will add more JPEG compression options in this dialog later than 0.9.0. But, for 0.9.0, added subsampling options in digikam jpegloader is a good idea. Can you give me a little patch against svn for that. Thanks in advance ! Gilles Caulier
SVN commit 566091 by cgilles: digikam from trunk : DImg:JPEGLoader : set horizontal and vertical Subsampling factor to 1 for a best quality of color picture compression. CCBUGS: 130996 M +10 -1 jpegloader.cpp --- trunk/extragear/graphics/digikam/libs/dimg/loaders/jpegloader.cpp #566090:566091 @@ -467,11 +467,14 @@ uint& h = imageHeight(); unsigned char*& data = imageData(); + // Size of image. cinfo.image_width = w; cinfo.image_height = h; + + // Color components of image in RGB. cinfo.input_components = 3; cinfo.in_color_space = JCS_RGB; - + QVariant qualityAttr = imageGetAttribute("quality"); int quality = qualityAttr.isValid() ? qualityAttr.toInt() : 90; @@ -481,6 +484,12 @@ quality = 100; jpeg_set_defaults(&cinfo); + + // B.K.O #130996: set horizontal and vertical Subsampling factor to 1 for a best + // quality of color picture compression. + cinfo.comp_info[0].h_samp_factor = 1; + cinfo.comp_info[0].v_samp_factor = 1; + jpeg_set_quality(&cinfo, quality, true); jpeg_start_compress(&cinfo, true);
J. Westveer, I mark this B.K.O file like dupplicate of #123649. Please post your future comments in this thread. Thanks in advance. Gilles *** This bug has been marked as a duplicate of 123649 ***