JPG Compression - The Bandwidth Saver
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."
Computers can make problems requiring complex repetitive calculations a much less onerous task to solve. I highly recommend that people apply computers to difficult scientific questions.
Edith Keeler Must Die
Compression? I'd just been renaming my .bmp's to .jpg - you mean I actually have to "compress" them to a .jpg to gain any benefit? Wow, my readers will sure be pleased. Next, you'll be telling me that my Flash-only websites should use shapes & instances instead of manually manipulating every pixel.
I once shot a man in Reno 'cause they cancelled Firefly.
In other news:
Anonymouse Cowarde has posted an article entitled "Power Switch - The Energy Saver". An article for geeks and computer owners showing how they can significantly reduce the amount of power they use by turning off your computer when you're not using it, using one of the most common buttons found on the front of most PCs. If you own a computer and don't yet have knowledge in the field of energy, you should find this very interesting indeed - Save money on electricty and please your significant other at the same time with a quieter room and lower energy bill. They also talk briefly at APM.
When are we going to start evolving these algorithims? It would have to be done by a really fast computer, but it's been shown that natural selection applies to computing as well. I'd imagine that it is possible to come up with an algorithim that's lossless and still as small as any equivalent .jpg file. Nature can come up with things we never even imagined. This technique has been used to create a sorting program that is smaller works faster than any we ever created manually. And we often can't figure out how it works. Not a clue!
Remember "Bring 'em on"? *sigh
Short run down of the linked-to article:
Non-compressed images have a large filesize and cost a lot of bandwidth, compressed images look almost as good and cost less bandwidth.
Guide to compress images in PSP 7: save, move slider.
conclusion: compressing is good, hope you found this useful.
*shakes his head sadly* Slow down are fine, but c'mon - we're geeks you know; we can be expected to at least know *some* things...
Although jpg compression is definitely helpful, the article forgets to mention that two image formats are supported by all browsers. GIF being the second. GIFs should be used for vector based graphics and provides a better overall quality/size advantage when done right. Many non-professional webpages confuse the distinction and make solely jpg or gif based websites. He should also have explained the compression techniques using photoshop as that is a much more popular package (although I understand that many home grown websites might be using PSP, they are also the ones that don't really care about bandwidth since they're using geocities or other free hosts).
JPEG has been around almost as long as I can remember the Internet. I remember spending long hours downloading single pr0n pics from Lynx using the Kermit protocol. Too bad half of 'em were zipped bitmap files instead of JPEGs.
Job? I don't have time to get a job! Who will sit around and bitch about being broke and unemployed then?
Q: What's the best way to speed up your connection?
A: Run less data through it.
I can write an article about this if Slashdot is interested.
"Derp de derp."
Now say 2000 different people read that same review uncached, we save a total of roughly 908mb in outbound data bandwidth for that single review. If 5000 people were to read that review, we are talking gigabytes of bandwidth which can be saved through compression, 2.27gb to be exact. I'll let the stunning numbers speak for themselves.
Sorta ironic how thousands of people are downloading that article right now!
Web Designer 1: "Hey, this JPG compression will save our average 56k user about 5 seconds on load time."
Web Designer 2: "That's means we can load even more useless content on our website and they won't notice the difference!"
Web Designer 1: "As well as include more popup and banner ads, too!"
i use LZW, if that helps?
I want 2D games back.
Why does it feel like 1994 all over again?
JPEG'ing images has been par for the course for any competant web designer since the very incarnation of the WWW.
This is like having a 'news' article to the effect of
"Make your HTML code smaller! Learn what the tags actually are and throw out FrontPage!"
Oooo gee, wow!
Endless arguments over trivial contradictions in books written by ignorant savages to explain thunder in the dark.
For slashdot, I would expect at least something on the order of a tutorial, or perhaps some study on a better compression method for jpeg. obviously 99% of the readers here know that jpeg can be compressed.
Interesting that this would be posted no less than three days after Penny Arcade's screenshot rant from Wednesday.
I have to say that I agree with Tycho and Gabe on this one. All too often I'm seeing websites post crappy images claiming that they show intricate detail of upcoming software, yet they compress it to the point that it looks like it came out of one of these.
"Mod, mod, mod...and another troll bites the dust."
Oh well, maybe I'll write an article about how to reduce size of GIF files using a smaller color pallete and turning off dithering so it can compress better... :-(
This article needs to be shown to just about every web graphics shop out there, but not to us self-righteous nerds! :)
I think he had a valid point. This article really does get filed under 'Duh'. There's a difference between having a negative opinion and trying to be offensive.
Frankly, I agree with him.
"Derp de derp."
Pardon me, I seem to have accidentally stepped into a conversation from 10 YEARS AGO.
If only MIME wasn't a hopeless mess in Linux.
I've had enough abrasive sigs. Kittens are cute and fuzzy.
Now, I can understand if slashdot wants to put techie reviews or such other geek stuff. That's understandable, in the case of YRO, company product release (that april spoof about sponsoring products was true, wasnt it?), and software issues.
HOWEVER, this is a geek site, which we talk as deeply as going about SMP on x86 systems and remodding systems into other cases (mechanics and engineering, lest that be software or hardware). However, that journalistic line (if there even was that line) has been crossed with this idiotic article. Let's re-read this again to see if it doesnt state the obvious. Also, I'm going to _assume_ that techie people on this website (most all) knows that jpeg is a compression....
Compression - The Bandwidth Saver
Hell, even non-techie people still know that if I zip that file, it doesnt take as long.... This article just insults our intelligence. Slashdot is becoming more and more like TechTV for the net.
And as a last mote, moderators, pay attention to *important stuff* below every post. This article is anything but offtopic.
While compressing your images should be right up there on the Web designer 101 course, sometimes I despair that the wrong types of compression are chosen.
JPEG is an excellent compression method for photographic images, both colour and greyscales. The image distortion is not noticeable by most people even at high compression ratios and the resulting image is close enough to the original.
JPEG is NOT an excellent compression method for line diagrams, maps and bitmaps featuring a limited colour palette - the artifacts created by the transforms used by the algorithms blur rapid changes in colour and can make text unreadable. Even worse, for most diagrams, PNG lossless compression yields smaller results because of the limited palette and large amount of redundancy inherent in the data.
JPEG 2000 promises even better compression ratios with superior image quality. Wavelet compression methods tend to reduce the amount of blur caused by the discrete cosine transforms and are better at handling rapid changes in colours. But that doesn't mean that it is a blanket solution.
I also look forward to the day when SVG is a widely available and widely supported browser option. We can all benefit when complex layouts can be described in terms of vectors and colour fills rather than overlarge and complex bitmaps for the classic web page touches like 3D colour balls and arrows. That will also save bandwidth while increasing the flexibility and variety of images on the web.
Cheers,
Toby Haynes
Anything I post is strictly my own thoughts and doesn't necessarily have anything to do with the opinions of IBM.
The article didn't discuss the merits of other formats vs. JPEG enough. Namely, non-photograhic images, with few colors and mostly large solid areas, such as icons, bullets, line drawings, diagrams, charts, etc. are not optimal for JPEG.
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.
There's 10 types of people in this world, those who understand binary and those who don't.
Yes, but using "JPG" instead of "JPEG" saves a byte of bandwidth.
As to this increasing the odds of Photoshop on any other Unix - I doubt it. The MacOS X port is to the proprietary backwards-compatible-with-MacOS "Carbon" layer and not writing to the BSD side of things. Thus it's really the old MacOS Photoshop rewarmed and running mostly on a cleaned-up set of APIs. The other changes that have been made are apparently mostly for interaction with the Quartz graphics layer and Aqua UI, again Apple-proprietary.
The next-gen evolution will likely be to MacOS X's Cocoa layer, yet again Apple proprietary. Thus unless someone ports Apple's Carbon library to another Unix or Apple decides to make Cocoa cross-platform along with support for a differing rendering layer we're unlikely to see any of this having any relevance to other Unix's. Of course they can all now talk seamlessly to Photoshop through scripting so they're not entirely out in the cold.
I don't read ACs: If a post isn't worth so much as a nom de plume to its author then I wont bother either.
It's quite a problem working on a XP/2000/9x machine which won't show me mpeg files when looking for mpg and the reverse.
There is little need for extensions what so ever when you are working in a graphical environment. The GUI can assign icons to types [if someone hasn't already monopolized on that media type and got their icon on the 'top].
In a console based environment there is also little need. Most users know what files are what and if they don't there is sometimes a color coding involved which helps you know what you can edit. [of course jpeg is little use to a console user].
As far as I know linux has no problem reading the content headers of files but I'm not an expert, just a user. I assume this is done on the interface level, somone speak up!
Get your Unix fortune now!
Sure, PhotoShop is nice - if you're running a Mac or Microsoft Windows(TM) box and a grand laying around. Paint Shop Pro is pretty nice, does most of what PhotoShop does for a tenth the price - if you're suffering under a MS OS. But hey, you can download GIMP for FREE. Heck, they even have a Microsoft Windows(TM) port. Sure, you can't save GIFs or dick with TIFFs, nor can you do a lot of stuff you can do in PhotoShop.
However, GIMP is great for most image manipulation needs.
It's unfortunate that the JPEG format ends up being described as the JPG, due to DOS naming constraints. Are we doom to see the usage of 3 name extension only in the future due to this lack of vision from the early implementers? I for one would tend to favor embedded MIME support and the removing of file extensions.
Here here. I'm sick of hearing people talk about HTM files. Mention assembly language, and they reply "oh, you mean ASM?" Even Windows isn't this dumb anymore; why haven't the users gotten better?
These morons are offensive to us Mac users, and they're polluting Linux too. Anyone have any suggestions for putting a stop to this?
$x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
$x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
Now if only they could convince people to build pages that have fewer than 100 GETs, it might actually make a difference.
I got trapped into clicking the link to the article, thinking it could be something useful about jpeg compression and how it works. The story certainly implied that. How disappointed I was, and I agree with most people that this is one of the dumbest stories ever. This kind of story belongs in a site for amateur wanna-be web designers, not geeks. Anyway, since I've gotten all caught up in this, and you're here too, maybe we can have a useful discussion on How JPEG Compression Works.
:), only the associated values need to be stored. I believe the first image deals with how much darker the left half is than the right half of the image, the second does the same thing horizontally, the third deals with how much darker the leftmost quarter of the image and the third quarter of the image are darker than the other two, and so on...
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.
The biggest bandwidth saving on many sites would be to generate PNGs with an appropriate number of colours. Very often you can reduce your image to 8, or even 4 colours with very little loss of quality but a big reduction in image size.
-- Ed Avis ed@membled.com
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. Use PNG for still images. Use SWF (now an open format) or MNG (not much browser support yet 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.
Will I retire or break 10K?
At my last job, we wondered why our carefully tuned images looked like shit on AOL. We found they were recompressing our jpegs to make them much smaller (and thus lower quality). So we now send AOL really high quality jpegs so that our images don't get trashed as badly by AOL.
Plato seems wrong to me today
Don't you just love it when you open a 1000-file directory and your hard drive grinds for 30 seconds while your file manager opens every last one of those files to peek inside? Then the GUI thread is bogged down while the icons are updated in real time.
I'd rather just use extensions, thank you. (And the thee character limit helps keep things short and sweet.)
Hey, the RIAA seems to have people trolling Slashdot now, so articles on the basics are necessary.
http://www.spinwave.com/crunchers.html is a great free website that can compress your JPEGs (and GIFs)...I use it all the time for the images on my site.
Orange
He doesn't appear to know a lot about what he's talking about. He calls a jpeg saved at 25% compression "25:1", where in fact the quality setting has direct relationship with file sizes.
Here are some tips I've found over the years of putting together web sites:
Yeah, from now on I'm only downloading .MPEGLAYER3
files to put in my music collection.
It would be interesting, if it'd been written and posted in 1992, rather than 2002.
I don't know who i'm most disappointed in.
A - Tweaktown, for posting such an inane article in the first place
B - MrTweak, for relaying it to slashot. Of course, he probably wrote it.
C - Hemos for posting it.
I mean really... the whole thing reeks of MrTweak wanting more site traffic and turning to slashdot with a story about anything to get it. Like "oh my god, i didn't know i could COMPRESS graphics?"
Proposal to slash: never accept submissions from people with obvious links to the article in question...
Wasnt that originally the idea for Jpeg?
----- Whats wrong with this picture? http://www.revoh.org:1234/whatswrong
would be "Stating the fucking obvious."
Jeez. Why is this on slashdot?
-- Will program for bandwidth
I submitted this story in 1990 and it was rejected. What gives?
As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
If you want to save bandwidth, just nuke the trash various image editing tools leave in the .jpg file. (E.g., use jpegtrans(1))
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.
For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken
This points out that choosing the proper compression format is not common knowledge, and there are still loads of people who confuse one over the other.
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).
We're talking about GUI icons here, Einstein. They're just hints for the user. Any non-broken program would check the actual file format before operating on a file. (Yes, I realize that a certain large OS company has written broken programs that assume the extension==file format. That's their problem.)
Mr. Tweak "submitting" a story about his own site, and Hemos going "yeah, now this is TECH!!!!!!!!!!"? Or is Tweaktown allied with /. in some way? No one reads this site anymore for the info, the reader comments are the most entertaining now. /. has become a joke regarding tech news.
If you do why not submit it to Web Monkey?
Video Game cheats, hints a
Did you mean JPEG?
I once had a die-hard mac user tell me that "JPEG" pictures evolved on the mac, because they had a four letter name, and type and creator info on mac files was four letters long. Nevermind that it was named after the Joint Photographic Experts Group...
autopr0n is like, down and stuff.
new headline: "Attracting user attention with the tag!"
Just raise the taxes on crack.
While these constraints aren't an issue for folks attempting to document illuminated manuscripts and other like materials they are very much a problem for folks on the World Wide Web. Unless you're going to insist on sending hapless browsers to an English-only website for an obscure plugin that few servers even have MIME-mapping for anyway, insist they install this plugin to their browser & OS assuming they're even supported ( oh wait - the website is now dead! ) then come back to browse a website, well good luck.
In the meantime the rest of us will lumber along using more general-applicability formats already widely supported by tools and browsers such as GIF, JPEG, increasingly PNG and somewhat TIFF. Let us know when you read another technology-of-the-future article from '98 though! Hey, check out IFF, another where-is-it-now (for good reason.)
I don't read ACs: If a post isn't worth so much as a nom de plume to its author then I wont bother either.
Smart site that, setting the style on their body text so that in Mozilla it's teeny-tiny. This form of compression saves the reader from time otherwise spent scrolling the screen. It saved me the time of even reading at all.
What ever did happen to the idea that the Web is about letting the user set their browser's default type size to suit their eyes, and writing pages that honor the user's preference?
___
"with their freedom lost all virtue lose" - Milton
How does the JPEG group make their money? Do they enforce a MP3-style licencing scheme, or is it a group effort of companies and organizations who would mutually benefit?
slashdot!=valid HTML
Also, there was a Solaris version as well.
There's 10 types of people in this world, those who understand binary and those who don't.
Be careful - this sort of article might lead to designers replacing text with .jpg images of the text.
DAMN! TOO LATE!
Yes, I thought it was common knowledge also. But I've noticed that there seems to be very little decrease in the use of GIF files in web sites
Well, for your information, certain programs (Front page extensions to be precise) rely on you using either gif or bmp for the backdrops on their automatically generated navigation icons and theme elements. Well, frontpage 2000 did, cant speak for 2002 extensions.
This makes alot of sense relative to JPG, but isn't as good as PNG, which seems to code the icons in about half the space.
You can still use any file format for the main body of your site, its just a failing (one of many) in the server extensions to generate icons on the fly.
My 2c worth,
Michael
There is no cryptographic solution to the problem where the intended receiver and the attacker are the same entity.
Oh yeah, no mention was made of Portable Net Graphics (PNG) file format and it's lossless compression, or any of the fine free software that utilizes it, GIMP, Electric Eyes, etc.
Friends don't help friends install M$ junk.
If they port it to the Cocoa layer, it may be compatible with GNUStep.
To get something done, a committee should consist of no more than three persons, two of them absent.
Yes, you're right- we live in a compressed age. Our digital TV is compressed, our movies are compressed, our music is compressed, our images are compressed.
Where we used to get uncompresssed we now get compressed because although the quality is worse, we can fit more stuff on whatever medium comes on.
I was just starting to really get pissed off about the world we live in, and then I discovered that Opera (which I only started using yesterday after using Mozilla for a while) hides the mouse pointer while you are typing- at last! Sanity! No more elbowing the mouse out of the way while typing in usernames on websites! Hoorah!
graspee
*Hemos and buds in a smoke filled room*
"Dude, this image is only 20 fucking kilobytes big."
"Whoa."
"Damn."
"You just blew my mind."
"POST IT!"
All these uncompressed TIFFs are making my web browsing a really slow experience.
Someone set us up the bomb, so shine we are!
Iexplore still can't render any PNG image with the least bit of transparent decency.
IE 6 on my machine handles indexed PNG images that use binary (not alpha) transparency just fine. This means that it will properly handle almost all PNGs converted from GIF, as GIF supports only binary transparency and only 255 colors per frame. (IE will not be able to handle PNGs converted from transparent high-color GIF images, that is, GIF images that use multiple frames, each with their own palettes, to draw 4,096 colors.)
You're right that IE 6 will screw up any other transparent PNG image though. But why, on a web site with a solid-color background, do you really need a transparent image? Yes, I know about the "PNG on top of JPEG" hack for site logos, but that typically uses an indexed PNG, putting any drop shadow or halo in the JPEG.
Will I retire or break 10K?
at first i wondered why this was posted to slashdot, but I slowly came to the realisation that this is a subtle bid to get rid of the recently added advertisements to slashdot.
FreeBSD for the impatient.
Why bother with inconveniencing web authors in any way(though I'll admit that using JPGs is hardly a huge inconvenience when most already use it) when you can just install mod_gzip on the web server, and use anything from a 8 bit GIF to a 24 bit BMP(sans compression at the file level) and get relatively good compression regardless?
It's been a long time.
GIFs have only 256 colors.
While you can offset this somewhat by using a selective pallette, most of the time it is still noticeable.
Tim
Omnia vestra castrorum habetur nobis.
That's a cop out. If you narrow "Linux" down to just the kernel, it's technically correct, but it allows you to ignore all the application space problems. That isn't productive.
When I said "Linux", I meant "common Linux distributions". MIME has no meaning in the context of the kernel.
I've had enough abrasive sigs. Kittens are cute and fuzzy.
20 January 2017: the End of an Error.
You are such a tool.
I don't mean thumbnails - and there is no need to 'peek' inside each file. The content is known just as fast as the file name.
Also, there is no "three character limit". For years I've been working in different MPEG-1 and MPEG-2 applications which will only save to four characters.
Good idea to rely on those letters which anyone could/can/will/does change.
Get your Unix fortune now!
any webmaster that hasn't checked out the bandwidth conservation society should be slapped
http://Lenny.com
4 great justice!