A few months ago I gave a 5 minute Ignite talk at the Velocity conference. (My previous post talks about the Ignite experience.) I thought they recorded the video and wanted to share but seems like it's not happening. So below are the slides from slideshare.
The ignite talk rules are: 20 slides that change automatically after 15 seconds. But I took the liberty of hacking the format a little bit. For one, the 18th (and 19th) slide which was my main point is duplicated. And then I had some transitions, like in the first two slides for example, where different text or pictures change after a timeout. I expanded those transitions for slideshare, so the slide count is 40-something, but at the presentation it was still total of 20 slides in 5 minutes.
If you follow the slides on slideshare, be sure to click the Notes tab which has what I said, more or less, at each slide. The full script is below.
And yes, if you like it, please vote for my South by Southwest panel proposal. It has the same name "Image Weight Loss Clinic" but will be a much longer version of this 5 minute Iginite and what is more - Derek Tonn of graphicsoptimization.com will share the stage with me. Pretty exciting, so cast you votes, leave a comment and help me get to SxSW.
Here's what I said, more or less:
- Letâ€™s talk a little bit about cutting back on that bandwidth bill. Saving some money. And without touching the code. How do we do that? One way isâ€¦
- Images. Ever since the dawn of times people have been using images. Cavemen scraping on their cave wallsâ€¦ and todayâ€¦ Today we have websites. And LOLcats.
- Half of the average web page weight today is images. And most of these images are too fat. They could use a diet and lose some weight but without losing quality, not even a single pixel.
- So, welcome to the Image Weight Loss Clinic. Our first patient today is... some random page found on the Internets. Hmm, what have we got hereâ€¦ Header graphic, speaker photos, logos, rotating banners â€“ the usual stuff.
- First problem - there are some GIFs. We shouldnâ€™t be using GIFs. PNG is the format for graphics - buttons, icons, and so on. The palette type of PNG, also known as PNG8 is good as a GIF and actually better. And PNG filesizes are smaller. Well, except for really tiny GIFs, but letâ€™s ignore these, they donâ€™t matter much.
- You should convert all your GIFs to PNG8. Thereâ€™s a number of tools to do this in a batch. You can use ImageMagick for example. â€œInstant results or your money backâ€. Especially since ImageMagick is free.
- For your JPEG photos, use JPEGTran. Itâ€™s free, cross-platform, command-line tool, easy to script. And itâ€™s lossless, you keep the photo quality. If you run it without setting any options, thatâ€™s good enough. Run with the
â€“optimizeand youâ€™ll get even better results.
â€“progressivemakes JPEGs that render in the browser from low resolution to high, as opposed to top-to-bottom. If the JPEG is bigger than 10K (which is most JPEGs), the progressive encoding has a good shot at giving you a smaller image. You can always brute force â€“ run with both options and take the smaller result.
â€“copy nonestrips all comments and meta data - camera model, geo location, everything. If you own the image, strip the meta data. Youâ€™ll be surprised how much bloat is in there. If you donâ€™t own the image, check with the owner. Option
â€“copy allkeeps all meta data.
- Next â€“ PNG. Thereâ€™s a lot of options to optimize PNGs - all lossless and scriptable on the command line. Some even have nice graphical UIs built on top of them, you know, for our command-line-challenged friends.
- Thereâ€™s even browser-based UIs, built on top of some of the tools. For example, smush.it, which is now part of YSlow runs PNGcrush. Googleâ€™s Page Speed runs OptiPNG.
- With so many PNG tools, how do you decide which one to pick? They are all good tools and they do their best, so if youâ€™re in a hurry, just pick one and go with it, script it. Youâ€™ll be pleasantly surprised by the outcome.
- Now if youâ€™re serious about PNG weight loss, you can run all the tools you can lay your hands on. Run the next tool on the result of the previous, try with their different options switches. They all do different things, and results may vary from one image to the next. Run them all in sequence and get an even smaller file at the end.
- Or, if youâ€™re hardcore â€“ run PNGSlim. PNGSlim is actually a Windows batch file that runs most of the other tools. Itâ€™s very slow, it can take hours to go through a handful of files. But at the end, it will give you the leanest, most optimized PiNG.
- Letâ€™s see some results. That page has a total page weight of over 800K, including scripts, styles, everything. Over 80% of the weight is images. And what happens after optimization?
- We can strip quite a bit, over 200K of unnecessary image information. 200K, thatâ€™s over 30% if the image weight. The page looks exactly the same, pixel by pixel. There was no manual work involved, just running some tools. I think 30% is pretty impressive.
- To summarize, donâ€™t use GIFs, run JPEGtran on your photos, and for the graphics - any PNG or all PNG tools.
- So the tools are available out there, now all you need is a process that runs the tools before your images go live. Make image optimization part of the push process.
- These are all lossless operations that donâ€™t require you to look at the images to verify theyâ€™re OK. So you can only win! And often youâ€™ll see some amazing and surprising results. Even if you normally do a good job with image sizes, thereâ€™s always a few that slip as you race against the deadline. The thing is â€“ setup a process, so you donâ€™t even need to think about it.
- Thanks very much, everybody! Iâ€™m Stoyan from Yahoo! Search. Enjoy Velocity, it's a great conference!