• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!


File formats and compression

Page history last edited by Jayashree Balaji 13 years ago

At the end of  this unit lesson you will be able to


  • Understand why you might need to compress files
  • Understand what are lossy and lossless file compression methods
  • List various graphic file formats
  • Use image manipulation software for file compression


It might be useful to check this page out: Understanding digital images and resolution



Image file formats

When an image is digitized, it takes on a specific file format. There are a wide variety of file formats, many of which are meant to store the large file sizes of digital images.



     Access these pages to read more of various file formats:  Image file formats    , and                                http://en.wikipedia.org/wiki/Image_file_formats#Major_graphic_file_formats 


High resolution cameras produce large image files, ranging from hundreds of kilobytes[1] to megabytes[2], depending on the camera's resolution[3] and the image-storage format capacity. We know that images are made up of pixels[4] (see unit on digital image capture, features and resolution). Image file size—expressed as the number of bytes—increases with the number of pixels composing an image, and the colour depth[5]of the pixels. The greater the number of rows and columns, the greater the image resolution and the larger the file. Each pixel of an image increases in size when its colour depth increases—an 8-bit pixel (1 byte) stores 256 colors, a 24-bit pixel (3 bytes) stores 16 million colors, also known as truecolor.


High resolution digital cameras record 12 megapixel[6] (1MegaPixel(MP) = 1,000,000 pixels / 1 million) images, or more, in truecolor[7]. For example, an image recorded by a 12 MP camera would occupy 36,000,000 bytes of memory; since each pixel uses 3 bytes to record truecolor, which is a great amount of digital storage for one image, given that cameras must record and store many images to be practical. Faced with large file sizes, both within the camera and a storage disc, compression methods and image file formats are being created and used to store such large images and transmit them.


Large file sizes make transmitting, sharing of files and upload onto web pages slow or even impossible. Compression is useful because it helps reduce the consumption of expensive resources, such as hard disk space. By reducing file size, you can store more images on the same disk space and transmit images faster. 


Image compression

Image compression can be lossy or lossless. Lossy compression is a Lossy compression

data compression method which discards (loses) some of the data, in order to achieve its goal, with the result that decompressing the data(graphic or otherwise) yields content that is different from the original, though similar enough to be useful in some way. Lossy methods are especially suitable for natural images such as photos in applications where minor (sometimes imperceptible) loss of fidelity is acceptable to achieve a substantial reduction in bit rate. These methods are most commonly used to compress multimedia data (audio, video, still images), especially in applications such as streaming media and internet telephony.



gzip icon Lossless data compression on the other hand allows data to be reconstructed from the compressed data. For example, it is used in the popular ZIP file format and in the Unix tool gzip. It is also often used as a component within lossy data compression technologies.Lossless compression is required for text and data files, such as bank records, text articles, etc. Lossless compression is preferred for archival purposes and often medical imaging, technical drawings, clip art or comics.







Try this activity on Image manipulation using any graphics software available on your computer (Microsoft Paint /Adobe photoshop or any other free software you may have installed)




1. File size


Pick a photograph that you have – yours or any other; it may be larger than it needs to be for a Web page. Generally, a complex photograph should be no more than 300x300 pixels, and a simpler photo can look fine at 100x50. Crop the photo to size. To see the image at the size it will appear on a Web page, select View | Normal Viewing.


2. Color correction


Try colors/gamma correction in your graphics program and make a note of what you see in terms of brightness and contrast.


3. Controlling jpeg compression


Set the compression levels at different percentages and see how compression levels affects quality of image. At what level (%) of jpeg compression do you get a good compromise of image size and quality?




 In conclusion, it is very important to optimize the size and resolution of digital images for sharing over the Web. Modern digital cameras and scanners can produce amazing, crystal-clear images, but at a price of very large file sizes. Most cameras and scanners come with free utilities that enable you to manipulate images. Other programs such as Photoshop or its freeware equivalent Gimp are fully featured, professional packages with many tools. 


The key to getting manageable images is to first reduce the size of the image. Experiment with some different sizes and resolutions to get a result you are happy with. Once you have manipulated your image for size, save it at the minimum quality as a web-compatible format such as JPG or GIF. These formats provide compression and make your file size even smaller by eliminating redundant data.


  1. The kilobyte is a multiple of the unit byte for digital information storage or transmission, equals 1000 bytes.
  2. Equals 1000kilobytes
  3. The number of pixels per square inch on a computer-generated display.
  4. The smallest discrete component of an image or picture on a computer screen (usually a colored dot).
  5. Color depth or bit depth,describes the number of bits used to represent the color of a single pixel.
  6. One million pixels, used as a unit of resolution of digital cameras.
  7. Truecolor defines 256 shades of red, green, and blue for each pixel of the digital picture, which ultimately results in 224 or 16,777,216 (approximately 16.7 million) color variations for each pixel.

Comments (2)

Jayashree Balaji said

at 8:03 pm on Apr 30, 2011

Available as a link to a separate page on raster and vector file formats

wayne mackintosh said

at 5:21 pm on Apr 7, 2011

Do we need a short subsection on different image formats?

I'm missing svg (which is increasingly a great resource for OER using free tools like inkscape to remix and mashup images.)

You don't have permission to comment on this page.