/Main_Page

::You must have ninja focus to complete your mission::NinjaFocus::

Image Compression

Views:


Got a load of images for the web and want them to load fast? You need to make them as small as possible but don't want to loose that all important image quality.

GIFs and PNGs

GIFs are old, PNGs are much more modern and better. There are two types of PNG graphics, 8 bit and 24 bit with alpha channel transparency. 8 bit PNGs can be used anywhere you use a GIF and they are supported by all of the browsers, even Internet Explorer 6. PNGs have a smaller file size for a like-for-like GIF file. 8 bit PNG supports the same colour depths but does not support animation.

To make your PNGs even smaller, use a program called pngcrunch to batch process the lot of them and make them tiny!!

JPEGs

Photoshop's Save for Web function does a pretty good job of making JPEGs really small, Gimp is even better. That's fine if you are able to save as you go, but if you have an existing collection of images you need to make smaller, then you can batch process them with Image Magick.

ImageMagick has two command line tools that are really useful for this. One (mogrify) will modify the files in place, the other (convert) will save the changes to new files. The easiest thing to do is to strip the EXIF data from the images, there is no need for all of this meta data on your web site, especially not in thumbnails, etc

$ mogrify -strip *.jpe?g #this will strip the EXIF data from all JPEG files in the current directory

Main Menu

Personal tools

Toolbox