[Digikam-users] jpeg compression

Thorsten Schnebeck thorsten.schnebeck at gmx.net
Sat Jun 30 18:56:50 BST 2007


Hi, 

> To have studied it indeep, i can said than :
>
> DNG == TIFF + new tag.
> DNG is now an ISO standard (i have seen a message about it into libtiff ML)
> DNG is limited to store image data in 2 way : the first is a pseudo
> lossless JPEG compression supporting 16 bits color depth (in fact JPEG
> algorith with compression level set to 100, but supporting 16
> bits/color/pixels). The compression ratio is good, but it still JPEG
> stuff... 

This is IMHO wrong. You mix up an image format with the Joint Photographic 
Experts Group. DNG uses JPEG lossless huffman:
http://en.wikipedia.org/wiki/Lossless_JPEG
or deeper:
http://www.hpl.hp.com/loco/HPL-98-193R1.pdf

> This way is used by all camera which support DNG as well, and not 
> the second way...
> DNG support only a _real_ lossless image data storage, which is in fact the
> linear 16 raw image data. DNG do not support the famous Adobe Deflate
> compression algorithm provide by TIFF file format. It really stupid... This
> one give the equivalent compression ratio results of PNG. If you try to use
> DNG converter from Adobe, and you use the RAW linear storage of image data,
> the DNG file will be huge !

The linear 16bit raw converted data is not recommended. I found this thread 
which helps to understand some DNG (fallback) concepts:
(from: http://www.adobeforums.com/cgi-bin/webx/.3bc0d8de)
> > goodlux  - 2:31am Feb 26, 07 PST (#14 of 15)
> > =============================
> > I wish this information was presented by Adobe in a clearer fashion,
> > perhaps in the help menu for the Converter itself.
> >
> > Users should be given a little more information so they can understand
> > some of the implications of using the various options that the converter
> > presents.
> >
> > For instance: it is helpful for a user to know that if they create a .dng
> > file and embed the raw file, and create a full-sized preview, that they
> > will end up with a file that is double the size of the original raw file.
> > So if they convert all their raw files this way, they will need double
> > the space.
> >
> > Also, I'm not clear at all about the whole "preserve raw image" vs
> > "convert to linear image" option at all. Why would a use want to do one
> > or the other? What are the pros and cons?
> >
> > Same thing about Lossless compression...why wouldn't someone want
> > lossless compression? Is there a performance hit? How much of a
> > difference does this compression usually make?
> >
> > I came across this post because I have the same question as the original
> > poster.
> >
> > How is it possible that a .dng file is smaller than the original raw
> > (.cr2) file? A .cr2 file is already compressed with lossless
> > compression...and that compression is fairly state of the art. How is it
> > possible that .dng can do it better? There must be some data getting
> > thrown out in the conversion...or else you wouldn't have the option of
> > embedding the raw file. So what is getting thrown out? How important is
> > it? I'm particularly concerned with Canon files.
> >
> > Does anyone have some solid, knowledgeable information?
> > 
> > **************************************************************************
> >
> > Barry Clive Pearson  - 8:10am Feb 26, 07 PST (#15 of 15)
> > ====================================
> > "Also, I'm not clear at all about the whole "preserve raw image" vs
> > "convert to linear image" option at all. Why would a use want to do one
> > or the other? What are the pros and cons?" By default, this is "don't
> > convert", and that is right. Converting it means doing a raw conversion,
> > which means that later products don't get their own chance to do it. (It
> > also results in a bigger file).
> >
> > Sometimes products can handle "linear DNGs" but not the unconverted DNGs.
> > For example, I've known products that can't handle the unconverted data
> > from a Fujifilm camera, but could handle the Linear version, so in that
> > case converting was the only way to get the file processed by that
> > product.
> >
> > "Same thing about Lossless compression...why wouldn't someone want
> > lossless compression? Is there a performance hit? How much of a
> > difference does this compression usually make?" I think there have been
> > products that couldn't uncompress DNG files, but that doesn't appear to
> > be common. So normally compressed DNG is good.
> >
> > "How is it possible that a .dng file is smaller than the original raw
> > (.cr2) file? A .cr2 file is already compressed with lossless
> > compression...and that compression is fairly state of the art. How is it
> > possible that .dng can do it better?" DNG just does it a little better!
> > (In fact, CR2 and DNG both use the same type of lossless compression, but
> > there appears to be different levels of compression, perhaps because DNG
> > tiles it in a way that optimises compression?)
> >
> > DNG files from CR2s should hold a superset, not a subset, of what is CR2
> > files.


> For me DNG do not give any advantages against PNG...
>
> Gilles

The main difference is that DNG can keep the mosaiced representation of the 
sensor in the image data. Together with new standard and open metatags you 
can use future raw converter techniques with your original sensor data.
In PNG the image representation is already RGB ordered.

This handles (in http://www.adobe.com/products/dng/pdfs/dng_spec.pdf )
the "PhotometricInterpretation" metatag.
When the spec speaks from CFA they mean Color Filter Array - this is the 
sensor pattern.

DNG is not that evil ;-)

HTH
  
  Thorsten
   



More information about the Digikam-users mailing list