📚 IGCSE ICT Study Notes: File Size Reduction (Images Focus)
Hi there! This chapter is all about making your digital files, especially images, smaller and more manageable. Why is this important? Because large files are slow to send, take up valuable storage space, and can slow down websites. Learning these techniques is key for efficient file management in the real world!
Think of file size reduction like trying to pack a suitcase. You need to fit the maximum amount of necessary clothing (data) while making the bag as small and light as possible (file size).
1. The Need to Reduce File Sizes
The syllabus requires you to understand why we need to make files smaller, both for storage and transmission.
Why reduce file sizes? (The Two main reasons)
1. Storage Efficiency
- Large files quickly fill up storage devices (hard drives, flash drives, or cloud storage accounts).
- By reducing the size, you can store more files on the same device.
2. Faster Transmission
- When you email an image or upload it to a website, the file needs to be transmitted (sent) over a network.
- Smaller files take less time to upload and download, especially important if users have slow internet connections.
- Websites with large images load very slowly, leading to a poor user experience.
2. Reducing Image File Size: The Core Methods
When dealing specifically with digital images (like photos or graphics), there are two main factors you can change to dramatically reduce the file size. Both methods involve sacrificing some degree of image quality, so it's a balance!
(Syllabus requirement: Recognise that reducing the file size can be achieved by reducing the image resolution or colour depth.)
2.1 Method 1: Reducing Image Resolution
What is Resolution?
Resolution refers to the number of pixels (dots) used to make up an image. It is often measured in dots per inch (DPI) or simply the total pixel dimensions (e.g., 1920 x 1080 pixels).
How Reduction Works:
If you reduce the resolution, you are literally throwing away pixels.
- A high-resolution image (e.g., 4000 pixels wide) used for printing might be reduced to a low-resolution image (e.g., 800 pixels wide) suitable only for a small webpage display.
- Fewer pixels = less data = smaller file size.
Trade-off (The Downside):
If you reduce the resolution too much, the image will appear pixelated or blurry when viewed at a large size. You lose detail.
Example: If you take a high-quality photo from your phone (high resolution) and resize it to fit as a tiny profile picture (low resolution), the file size shrinks dramatically.
2.2 Method 2: Reducing Colour Depth
What is Colour Depth?
Colour depth (measured in bits) determines the maximum number of colours that can be displayed by each pixel in an image.
- A high colour depth uses more bits per pixel, allowing for millions of colours (e.g., 24-bit colour). This looks very realistic.
- A low colour depth uses fewer bits per pixel, restricting the palette to hundreds or even tens of colours (e.g., 8-bit or 4-bit colour).
The Calculation:
To find the number of colours, use the formula \(2^n\), where n is the colour depth in bits.
- 24-bit True Colour: \(2^{24}\) = over 16 million colours (large file).
- 8-bit Colour: \(2^8\) = 256 colours (smaller file).
How Reduction Works:
If you reduce the colour depth (e.g., from 24-bit to 8-bit), the computer has to approximate millions of colours using only 256 colours. Since each pixel now requires fewer bits to store its colour information, the file size decreases.
Trade-off (The Downside):
Reducing colour depth can cause colour banding or make the image look flat and unrealistic, especially in photos with subtle gradients (like a sky or skin tone).
Just remember: If you want a smaller image file, you must either reduce how many dots you have (Resolution) or reduce how many colours those dots can display (Colour Depth). Both reduce the amount of information stored.
3. General File Compression (.ZIP and .RAR)
While the image-specific methods change the quality of the image content itself, file compression is a technique used to 'shrink' the container file without necessarily changing the original data. This is often used to compress large documents, programs, or multiple files together.
(Syllabus requirement: Reduce file sizes for storage or transmission where necessary using file compression including .zip, .rar.)
3.1 The Concept of Compression
File compression is the process of encoding data using fewer bits than the original representation. This involves finding patterns and redundancies in the data and replacing them with shorter codes.
Analogy: Imagine a long sentence: "The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog." A compression program might define "TQB" as "The quick brown fox jumps over the lazy dog." The file now just reads "TQB. TQB." - Much shorter!
3.2 Common Compression Formats
The two most common archive formats used for general file compression are .zip and .rar.
- .ZIP: This is the most common format, usually built into operating systems like Windows and MacOS. It’s widely compatible.
- .RAR: This is a proprietary format that often achieves slightly better compression ratios than .zip, but typically requires specific software (like WinRAR) to open.
How they work:
- The compression software takes one or more files.
- It reduces the overall size and bundles them into a single archive file (e.g., MyProject.zip).
- To use the original files, the user must decompress or extract the contents from the archive.
Did you know? .ZIP and .RAR usually use Lossless Compression. This means no data is permanently lost during the process. When you decompress the file, it is exactly the same as the original file. This is essential for documents and programs!
Common Mistake Alert!
Students often confuse reducing image size by changing resolution (Section 2) with general file compression (.zip).
They are different!
- Changing Resolution/Depth: Permanently changes the image data (usually Lossy for images).
- Using .ZIP/.RAR: Packages the file into a smaller container without changing the underlying data (Lossless).
4. Summary of File Size Reduction Methods
To reduce the size of a file, especially an image, you have a toolbox of options:
To reduce size AND potentially change quality (Images only):
- Reduce Resolution: Decrease the number of pixels. The image gets physically smaller or blurrier when enlarged.
- Reduce Colour Depth: Decrease the number of bits per pixel. The image loses colour realism.
To reduce size without losing quality (Any file type):
- Compress/Archive: Use formats like .zip or .rar to bundle files and remove data redundancy (lossless compression).