Re: What is the most compact way to save Image in SQL server

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Tom Leylan (gee_at_iamtiredofspam.com)
Date: 02/18/04


Date: Tue, 17 Feb 2004 23:22:53 -0500

Hi Al,

Compression is a trade-off of time for space. Lossy compression
additionally trades off information for even more space. The trouble with
lossless compression is that it typically won't do well on binary data such
as images, audio and the like.. The reason I got such great compression on
the example I gave is only because I made the image a single color.
Obviously most images won't be a single color and a photograph will compress
a few percent at most (depending upon the format.)

The way you get the greatest compression is by storing the image in a lossy
format (as opposed to a lossless format.) Compression in JPEG images for
instance can be controlled and you can decide how much detail to lose. As
you lose detail you gain additional compression.

You have to base your decision on what the images consist of (line drawings
or photographs) and what the purpose they are ultimately intended for. If
they are going to be displayed on a web page there is both a limit to how
long somebody will wait for the image and a resolution beyond which the
viewer doesn't care. So basically experiment a little bit and decide what
is an acceptable loss of quality.

It is pointless BTW to apply .ZIP compression to a JPEG image and it
actually should grow bigger as a result. Remember that JPEG "is" a
compression algorithm, if it was possible to compress the image even more
then JPEG would simply do it. Once the data is "random" further compression
becomes impossible.

Tom

"Al" <anonymous@discussions.microsoft.com> wrote...
> So Tom, How would you implement either of these algorithms in vb.net and
ado.net?
> thanks
> Al



Relevant Pages

  • Re: pdfcompresslevel (help!)
    ... The data of JPEG images aren't changed or scaled down. ... Especially \pdfcompresslevel doesn't change the lossy compression ... ratio of JPEG files (higher compression rates cause data loss). ... differentiate between the image sets. ...
    (comp.text.tex)
  • Re: compressing compressed video
    ... principle of the loseless compression is the same as the lossy compression. ... Remind that the principle of the lossless compression is to allocate the less number of bits to the more common word until reaching the entropy of information as closely as possible. ... However, vice versa is possible in many cases since the way of the lossy compression is to allocate more less bits to the comman words than that by the lossless one, which leads the information rate to below of the entopry rate until satisfying certain thresholds or conditions. ...
    (comp.compression)
  • Re: pdfcompresslevel (help!)
    ... Also package hyperrref sets the compression level to 9. ... The data of JPEG images aren't changed or scaled down. ... Especially \pdfcompresslevel doesn't change the lossy compression ... The full data and resolution can be used for the print version ...
    (comp.text.tex)
  • Re: Why are my D3 NEF files SMALLER than my D2X?
    ... The new "Lossless compression" mode is an ... and there was no lossless compression mode. ... lossy compression have to do with dropping some of the highlight data ... That could *always* be turned off on the pro models. ...
    (rec.photo.digital.slr-systems)
  • Re: Hope & Same
    ... Lossless compression compresses the data, ... Lossy compression for pictures (or music, ... Lossless compression *does* affect the ...
    (rec.arts.sf.fandom)