JPG Compression - The Bandwidth Saver 316
Mr.Tweak writes "TweakTown has posted an article entitled "JPG Compression - The Bandwidth Saver". An article for webmasters and site owners showing how they can significantly reduce the amount of bandwidth they use by compressing JPG images, one of the most common formats for web images. If you own a website and don't yet have knowledge in the field of JPG compression, you should find this very interesting indeed - Save money on bandwidth and please viewers at the same time with quicker loading webpages. They also talk briefly at JPEG2000."
slow day at slashdot (Score:1, Informative)
JPEG is not appropriate for all images (Score:4, Informative)
In such cases, GIF and PNG will yield much better compression than JPEG, and also look nicer, since they're lossless. Compressing such images with JPEG will give you ugly "ringing" artifacts, since the lines are essentially infinite-frequency "spikes" which you can't capture completely.
How jpegs work. (Score:4, Informative)
I am by no means an expert, and I believe this is a gross simplification of the process, but here is what I think happens. The jpg alg breaks the image apart into 8 pixel by 8 pixel subimages. (Don't ask how it handles pictures that are not n*8 x m*8 in size). Then it treats each of those images with a process very similar to principal component analysis, where a set of representative images are given associated multipliers of how much of that image to add into the reconstructed original image the user is trying to get. These representative images are ordered from least to most detailed, and since they are known to both the compressor and the uncompressor (depressor?
So how does one adjust image quality / compression? Well every possible 8 x 8 picture can be represented with 64 of these representative images. However, since the 64th deals with *really* minute details, then you can get a decent reconstruction using just 63. It all depends on the image you are trying to compress, but can probably get away with even just the first 20 of the basis images. Oh, for the record, I'm talking about grayscale here. I think you'd need to ramp things up by a factor of 3 to do rbg.
If someone wants to fill in any gaps or factual inaccuracies, certainly do so.
Instead of GIF, use PNG or SWF (Score:5, Informative)
Although jpg compression is definitely helpful, the article forgets to mention that two image formats are supported by all browsers. GIF being the second.
In addition, 4.0 and newer browsers support Portable Network Graphics (PNG).
GIFs should be used for vector based graphics
No they shouldn't [burnallgifs.org]. Use PNG for still images. Use SWF (now an open format [openswf.org]) or MNG (not much browser support yet [libpng.org] but works in Mozilla and Konqueror) for animations.
and provides a better overall quality/size advantage when done right.
PNG can be 10% smaller than GIF when crushed properly [sourceforge.net].
aol recompresses your jpegs (Score:5, Informative)
JPG Compression... (Score:2, Informative)
Orange
just nuke the trash in the .jpg file (Score:3, Informative)
Maybe you want to keep thumbnails in images on your development system, but all they do is burn bandwidth on the production system. You can usually reduce the size by a significant amount, even if you decide to add your own copyright messages, etc.
Re:JPG? (Score:2, Informative)
Why not ???
It we never educate the clueless we will have a world of clueless people...
For example people who write fantastic 'expert' 'high-tech' articles of how you could - gasp! - compress images so they are faster to download.
By not helping him he will could spread his 'expert' knowledge to others. In the long run he probably would have been better off by you telling him the truth.
Re:Um, I thought this was common knowledge... (Score:3, Informative)
JPEG is not better than GIF/PNG, but rather it's for a different purpose: As others have pointed out (hence I'm being redundant), JPEG is for photo-realistic images with lots of smooth gradiants and subtle tone changes. JPEG is lossy, meaning that if you did a perpetual cycle of compression/decompression you continually degrade the image. GIF/PNG is not lossy, and the decompressed image is exactly the same as the original (like LZWing the file), and it is useful where you want precise images (such as icons, banners, graphical text, etc.). GIF can actually compress comic type images to a much greater degree than JPEG can (and, because it's lossless, you don't get the artifacts of JPEGs).
Re:How coincidental. (Score:5, Informative)
That's JNG (JPEG Network Graphics) which is JPEG wrapped in PNG-style chunks along with an optional alpha (transparency) channel. Mozilla will display them and IrfanView will process them.
The JNG spec is available somewhere on the PNG web site, http://www.libpng.org/pub/png
Bandwidth conservation society (Score:3, Informative)