Bitmaps   page 5  

 Compression Issues

Compression is a way of reducing the file sizes of images. It is used very widely in computer graphics.
Without compression, a typical DVD would only be able to show a few minutes of video!

There are two general types of compression, lossy and lossless:

Lossy Compression

There are all sorts of lossy compression methods, but the one thing they have in common is this: they do a good job of taking complex images, such as photographs and reducing their file size, sometimes by dramatic amounts. Hence the use of lossy jpeg images on the Internet to save bandwidth. The second thing they have in common and the downside is that they throw information away when they work on an image and this information can never be regained.
You should always try to avoid using lossy compression when animating unless you have a problem with lack of computer memory or you need to send or receive an image using a slow modem.
A lossy image will always have some sort of artefacts even though they may be very slight. If you load up a lossy image such as a jpeg file then re-save it as a new jpeg file, the problem increases. The quality will always go down each time the image is copied and re-saved. Don't get confused, however, with the issue of copying the picture file itself. You can copy a jpeg file as many times as you like and email it without any loss of quality  - a computer file copy will be identical to its original unless it becomes corrupted, in which case it will probably be lost altogether.
If you need to send or receive a high resolution image of, say, a background, here is what I suggest: make the picture bigger by a factor of at least 2 than it really needs to be. (For example, if the image is 800 pixels in width, save it at, say, 1600 pixels in width). Then you can set a degree of compression when the picture is being saved until it is an acceptable file size. I find that even a very high resolution jpeg picture can be reduced to 600K or so and the compression artefacts are then virtually invisible, especially as most work ends up as low resolution TV pictures.

Our blue sphere is seen once more below. The file size is now much smaller, but it also looks much the worse for wear, with typical jpeg artefacts particularly visible round the edges. These are a sure sign that the compression factor has been set too high:

The most commonly encountered lossy compressed file format is JPEG
(these files are normally suffixed .jpg or .jpeg). There are other kinds of lossy compression available in proprietary formats, but a problem with these is that not everyone can "read" them.
For still imagery, jpeg is universally used and for moving images, the most common standards are variants of mpeg.

Lossless Compression

This is a way of compressing an image, that is making it a smaller file size, that involves no loss of quality. Lossless compression throws away redundant information. For example, a classic cartoon film character will be made up mostly of completely flat areas of colours. This means that any two adjacent pixels in the image will quite likely be identical in tone and colour values. The software therefore just saves the information of one pixel and records "ditto" for the identical surrounding pixels. Obviously, this type of compression will not work very well with busy complex imagery such as photographs or images with noise or grain where almost every pixel may be different, but for much animation work it is an excellent way of cramming more images on to a CD or saving disk space. Theoretically, the compression and decompression will take extra time, but in practice, this is not in any way a problem.

As a rule, lossless compression is a good idea when you are working in animation - provided only that you make sure that if the files are to be sent to someone else, they can read them! The easiest way to find out is to send them a test frame or two.

Most commonly used lossless compression file types are: TIF (suffix .tif or .tiff) and PNG

There are many "flavours" of TIFs - I recommend that you use RGB TIFs with LZW compression since I have yet to find a recipient unable to open this type.

 

 page 6            "Pixels and Pegbars" contents             home