ikibits.co.uk      Getting Started Common Applications Networking

Introduction

Now I was going to ramble on about how to use some free image editing software here but instead I'm going to ramble on about pixels, resolution, bitmaps and compression.

Let's start small, at the level of the pixel. Pixels are the smallest displayable unit that makes up the matrix of the display.

Here is a representation of a matrix of 8x8 pixels. If all that could be displayed were 2 colours, black or white for example, it would require 8x8x2 bits of memory to display = 128 bits or 16 bytes of memory.

For 16 colours: 8x8x16 = 1024 bits or 128 bytes

For 256 colours: 8x8x256 = 16384 bits or 2048 bytes or 2 kilobytes (kb)

For 16.8 million colours: 8x8x16.8 million = 1075200000 bits or 134400000 bytes or 131250 kilobytes (kb) or 128.2 Megabytes (mb)

So you can see that the amount of memory required for an image is dependant not only on its physical size but also on its colour depth.

The physical size of a matrix of pixels is sometimes referred to as its resolution. Typically CRT and flat-panel screens (monitors) display at a claimed colour depth of 16.3 million colours. When considering displaying images in a web page, or as an e-mail attachment, bear in mind the size of the display of the person recieving the image. As monitors can only display at a certain resolution, displaying a higher resolution image will result in the image scrolling at the sides of the screen or being re-sized automatically. So the highest resolution to be considered should be tailored to around 800x600 or 1024x768 pixels for web-pages at a maximum, and around 800x600 pixels maximum for e-mail - as some of the screen is taken up by the e-mail program.

Digital cameras tend to be marketed in terms of megapixels, which is simply the sum of the resolution. E.g. 1024x768 = 0.8 MP, 1280x1024 = 1.3 MP, 2560x2048=5.2 MP. It is worthwhile to note that the quality of an image in digital photography has very little bearing on the pixel resolution, although they are frequently marketed as such.

Compression and file extentions

Now lets turn to compression. So far I have been loosely discussing bitmaps (using the file extention .bmp) which can be described as lossless. Another file extention for lossless compression is commonly referred to as GIF's [Graphics Interchange Format], with the file extention .gif. In order to reduce the memory taken up by an image for the same resolution, some of the image data can be lost without sacrificing too much of the image quality. This is called compression. In terms of still images, commonly used compression techniques have the file extention .jpg, and .png. The file extentions are an abbreviated form of Joint Photographic (Expert) Group, and Portable Network Graphics. Compressed image data has the advantage of being able to display an image quickly, taking up the least memory for storage, display, and image transfer.

Programs that convert image data, such as Adobe "photoshop elements" also allow you to change the resolution, the number of colours used and what is refered to as the compression ratio for .jpg images, as well as all the other commonly used file extentions and formats. You can also find a heap of free image scaling software at download.com or tucows.com.

Conclusion and References

To conclude, a reasonable sized photograph for e-mail would be between 400x300 and 800x600 pixels, compressed as a jpeg to beween 300kb and 500kb maximum in size. In order to do this you will need some image manipulation software (free for those that can find it, and for Linux users). Images for display on websites should be as small as possible so that web pages load faster. Consider reducing the colour pallate and using the .gif or .png format for logos and simple graphics requiring sharp contrast. Aim for an image size of around 10kb.

References

Wikipedia reference on GIF's
Wikipedia on Image compression
And Wiki's entry on JPEG's
Free software for image manipulation from download.com
Free software for image manipulation from tucows.com
How digital cameras work

Previous: Configuring E-Mail

Next Chapter: Networking - Introduction