Welcome to the World of Digital Images!
Have you ever wondered how a computer, which only understands 1s and 0s, can display a beautiful sunset or a crisp company logo? In this chapter, we are going to dive into Representing graphics. We will explore the two main ways computers store visual information: Bitmapped graphics and Vector graphics. By the end of these notes, you’ll know exactly how to calculate file sizes and choose the right format for any project!
3.5.5.1 Bitmapped Graphics
Think of a bitmapped image like a giant mosaic or a piece of graph paper. If you zoom in far enough on a digital photo, you will see it is made up of tiny little squares. These squares are called pixels (short for "picture elements").
Key Concepts for Bitmaps
- Pixel: The smallest single point in a graphic image.
- Size in pixels: This is the resolution of the image, calculated as \( \text{width} \times \text{height} \). For example, a screen resolution of \( 1920 \times 1080 \) means there are 1920 pixels across and 1080 pixels down.
- Colour Depth: This is the number of bits used to represent the colour of a single pixel. The more bits you use, the more unique colours you can show!
Analogy: Imagine a "paint by numbers" kit. If you only have 1 bit, you can only use 2 colours (Black or White). If you have 8 bits, you can choose from 256 different colours!
Calculating Storage Requirements
One of the most common exam tasks is calculating how much space a bitmap takes up. Don't worry if math isn't your favorite subject—the formula is very straightforward!
The Formula (Excluding Metadata):
\( \text{Storage requirements (in bits)} = (\text{width in pixels} \times \text{height in pixels}) \times \text{colour depth} \)
Step-by-Step Example:
Calculate the file size in bits for an image that is 10 pixels wide, 10 pixels high, with a colour depth of 8 bits.
1. Find the total number of pixels: \( 10 \times 10 = 100 \text{ pixels} \).
2. Multiply by the colour depth: \( 100 \times 8 = 800 \text{ bits} \).
3. To find the size in bytes, divide by 8: \( 800 / 8 = 100 \text{ bytes} \).
What is Metadata?
A bitmap file isn't just a list of colours; the computer also needs to know how to "assemble" the pixels. This extra information is called metadata (data about data). Without metadata, the computer wouldn't know where one row of pixels ends and the next begins!
Typical examples of metadata include:
• The width of the image
• The height of the image
• The colour depth
• The date the photo was taken
Quick Review: Bitmaps are made of pixels. More pixels or higher colour depth means a better image, but a much larger file size!
3.5.5.2 Vector Graphics
Vector graphics work very differently. Instead of storing a grid of coloured pixels, a vector image stores a list of objects and their mathematical properties. It is like giving the computer a set of drawing instructions.
Typical Properties of Vector Objects
When you draw a circle or a square in a vector program, the computer records things like:
- X and Y coordinates: Exactly where the object is located (usually the top-left corner).
- Colour of object outline: The "stroke" colour.
- Line width: How thick the outline is.
- Colour of object fill: The colour inside the shape.
- Specific dimensions: Like the radius of a circle or the width/height of a rectangle.
Did you know? Fonts (like the one you are reading now) are usually stored as vector graphics. This is why you can make text huge without it becoming "blocky" or blurry!
Key Takeaway: Vectors don't care about pixels. They care about geometry and math.
3.5.5.3 Comparing Bitmapped and Vector Graphics
Choosing between a bitmap and a vector is like choosing between a photograph and a blueprint. Each has its own strengths!
1. Scaling (Resizing)
• Bitmaps: When you enlarge a bitmap, it becomes "pixelated" (you see the squares) and loses quality.
• Vectors: You can scale a vector to the size of a skyscraper or down to the size of a stamp, and it will remain perfectly crisp and smooth. This is because the computer just recalculates the math for the new size.
2. File Size
• Bitmaps: File size depends on the dimensions and colour depth. Large, high-quality photos have very large file sizes.
• Vectors: Usually much smaller than bitmaps because they only need to store instructions for a few shapes, regardless of how big those shapes appear on screen.
3. Realism
• Bitmaps: Great for complex images with many tiny colour changes, like photographs of people or nature.
• Vectors: Best for simple shapes, logos, icons, and technical drawings where precise lines are more important than realistic shading.
Summary Comparison Table
Bitmapped Graphics:
• Pros: Handles complex detail/photographs well.
• Cons: Large file sizes; loses quality when resized.
Vector Graphics:
• Pros: Small file sizes; can be resized without losing quality.
• Cons: Cannot represent complex, realistic photographic images effectively.
Common Mistake to Avoid: Students often think "higher resolution" means "vector." Remember, resolution only applies to bitmaps. Vectors don't have a set resolution until they are printed or displayed on a screen!
Final Encouragement: Don't worry if the calculations feel a bit dry! Just remember the core idea: Bitmaps are grids of squares, and Vectors are lists of shapes. If you can remember that, the rest of the details will fall into place easily!