[Digikam-devel] Thumb database image format... More investiguation

Marcel Wiesweg marcel.wiesweg at gmx.de
Tue Jun 9 16:48:43 CEST 2009


> Tests have been performed using 10 different photos from my
> collections. Image sizes are 256x256 (a real rectangle with image
> data)
> PNG files are generated with ImageMagick from bmp reference images.
> There is _no_ metadata in PNG (pure image)
> This point is important, because with my previous tests, i have use
> PNG file generated from JPG with a lots of metadata. For small images,
> this is not valid because metadata are large.
>
> Files Generated are :
>
> - JP2 (JPEG2000) in lossless
> - PGF in lossless (quality=0)
> - JPG with quality = 100 ("-q100" : not lossless but at least the best
> quallity) - JPG with quality = 85 ("-q85" : the default value used
> everywhere IM, gimp, photoshop, etc.)
>
> JPG quality 85 is the best. Gain = 5
> JPG quality 100, PGF and JP2 give the same size. Gain around 1.3.
>
> Of course, we can use PGF and JP2 compression level not lossless. file
> size will be decreased, but what will be the gain here against JPG in
> this case ?

That the main question for me. Why did people bother to write other 
compression methods when JPG is available? Usually it's a better file size vs. 
quality ratio. Encoding and also decoding performance usually decrease (need 
better hardware if time critical) because of more complex algorithms (think of 
video: mpeg2 vs. mpeg4 derivatives)

For me as a casual observer the main difference between PGF and JPEG2000 on 
the on side and JPEG on the other is the use of discrete wavelet transform vs. 
discrete cosine transform. I case of lossless compression the resulted 
coefficient are not quantized. In this case the main difference of the formats 
cannot be tested, I would not compare JPEG, PGF and JPEG2000 with lossless 
compression.
With lossy compression I would expect to have a (measurably) better quality 
with wavelet formats than with JPEG at the same file size, or, for us, a 
smaller file size for the same measured quality. Alas, I have not the tools to 
measure quality and dont trust my subjective impression on this too much, so I 
need to believe what is published.
From wikipedia:

"PGF was created to improve upon and replace the JPEG format. It was developed 
at the same time as JPEG 2000 but with a different focus: speed over 
compression ratio."
=> similar to JPEG 2000, but optimized for speed

"The JPEG 2000 is slightly more space-efficient in the case of natural images. 
The PSNR for the same compression ratio is on average 3% better than the PSNR 
of PGF.. Its small advantage in compression ratio is paid with a clearly 
higher encoding and decoding time."

"The image quality ... for the same compression ratio is on average 3% better 
than the PSNR of JPEG. At lower bit rates ... PGF has a much more significant 
advantage over certain modes of JPEG: artifacts are less visible and there is 
almost no blocking. The compression gains over JPEG are attributed to the use 
of DWT."
=> quality: JPEG < PGF < JPEG2000
	speed: JPEG > PGF > JPEG2000
	artifacts: JPEG << PGF, JPEG2000

"The PNG (Portable Network Graphics) format is still more space-efficient in 
the case of images with many pixels of the same color. It can be expected that 
PNG will be more heavily used for compressing diagram-type images and PGF for 
photograph-type images."
=> we are focusing on photos, so PNG is not playing its strengths for us
 
>
> >From speed viewpoint, it's really difficult to measure because a
>
> program need to be written instead to use command line.
>
> To check, i have used a slow computer (my old laptop PIII-600Mhz) and
> see from command line which conversion generate target files speedly.
> I can see JPG very fast and PGF is a little bit faster than JPEG2000.
>
> All test files are available here, if you want to check visual image
> quality : http://digikam3rdparty.free.fr/misc.tarballs/testdbthumbs.tar.bz2
>
> So, JPG sound like the best candidate...
>
> Your viewpoints ?




More information about the Digikam-devel mailing list