COMPUTER SCIENCE CAFÉ
  • WORKBOOKS
  • BLOCKY GAMES
  • GCSE
    • CAMBRIDGE GCSE
  • IB
  • A LEVEL
  • LEARN TO CODE
  • ROBOTICS ENGINEERING
  • MORE
    • CLASS PROJECTS
    • Classroom Discussions
    • Useful Links
    • SUBSCRIBE
    • ABOUT US
    • CONTACT US
    • PRIVACY POLICY
  • WORKBOOKS
  • BLOCKY GAMES
  • GCSE
    • CAMBRIDGE GCSE
  • IB
  • A LEVEL
  • LEARN TO CODE
  • ROBOTICS ENGINEERING
  • MORE
    • CLASS PROJECTS
    • Classroom Discussions
    • Useful Links
    • SUBSCRIBE
    • ABOUT US
    • CONTACT US
    • PRIVACY POLICY
DATA REPRESENTATION
1.5 IMAGE REPRESENTATION
Picture
WHAT IS IMAGE REPRESENTATION?
Just as numbers and letters are represented with Binary, so are images. To a computer an image is nothing more than a series of ones and zeros which allow the display of pixels in various colours.

To aid human reading of different colour codes, colours are commonly represented in Hexadecimal using the RGB Red Green Blue system. For example the chart below shows how pure blue is represented using HEX, the HEX code for pure blue is #00 00 FF, meaning it has zero red components, zero green components and the maximum amount of Blue components.
Picture
A brief colour chart for some of the other colours represented in hexadecimal.
Most software that allows you to manipulate images or colours will allow you to select colours by their HEX or RGB values.
Picture
Remember: Hex is used for our benefit to make it easy for use to see and work with, but the computer still deals with colour in binary format.
Image quality
The quality of an image depends predominantly of two factors, the amount of Pixels Per Inch (PPi) and the colour depth. The colour depth is determined by how many bits are used to represent each pixel, if 4 bits were used, most images would be grey scale, represented with only 2^4 (16) different shades possible to represent. HEX colour systems are commonly used and allow for 255 possible representations for each colour, Red, Green and  Blue which equates to 8 bits used for each of the 3 colour, meaning 24 bit colour depth per pixel (2^24 = 16777216), giving over 16 million individual colours.
The two images below illustrate the difference in image quality where the same image is represented on an 8 x 8 PPi scale and a 16 x 16 PPi scale, both images are the same physical size however the 16 x 16 image is better quality because more resolution is greater.
WHAT IS METADATA
Metadata is extra information that is within a picture file, as we learn from above the picture is actually just strings of binary, and within these string there is often extra data stored. This data often includes details of the device that took the picture and information such as the date the picture was taken. The amount of meta data has an impact on the actual file size of the image so calculating the file size from the image dimensions and bit depth might not be 100% accurate. 
For more info on metadata CLICK HERE - BBC BITESIZE
IMAGE FILE TYPES
There are many different type of images and each format has its unique attributes as follows:

JPEG or JPG : Joint Photographic Expert Group, a jpeg image has been compressed from its original size. The compression type is lossy, meaning it does loose some of its quality during compression. JPGs are good for photographs that require good quality images but a small data storage size, such as a photograph being used on a website.

Some other popular image file types include.
PNG: PORTABLE NETWORK GRAPHICS - Supports good quality graphics with 24BIT representation and designed to work well online through web-browsers.

GIF: GRAPHICS INTERCHANGE FORMAT - Normally not compressed and can retain features such as background transparency. The File can be large due to lack of compression. Compatible with many platforms.


BMP: BITMAP - Normally not compressed and therefore often maintain good quality but can take up more file space.
Picture
  • QUESTIONS #50
<
>
IMAGE REPRESENTATION
1: Explain what is meant by the term ‘pixel’?
2: What is meant by the term ‘megapixel’?
3: What is meant by the term 'colour depth'?
4: Suggest two things that happen when you increase the colour depth.
5: What is meant by the term ‘image resolution’?
6: 
Suggest two things that happen when you increase the image resolution.
7: What is a Vector Graphic?
8: What is Meta Data
9: Give an example of information that could be stored in Meta data
Picture
CALCULATING IMAGE FILE SIZE
Picture
IMAGE 1 : 8 x 8 pixels
Picture
IMAGE 2 : 16 x 16 pixels
To calculate the file size of the two images above, firstly although only two colours have been used, lets presume a colour depth of 8 bit for both images.
Image 1 calculation:
Firstly; calculate the total amount of pixels used in the image
8 pixels wide by 8 pixels tall:  8 x 8 = 64 (A total of 64 pixels used to represent the entire image)
Secondly; multiply the total pixels used by the colour depth (8 bits have been used to represent the content of each pixel)
64 pixels in total multiplied by 8(colour depth): 64 x 8 = 512
Answer: 
Image 1 has a file size of 512 bits

Image 2 calculation: 
16 pixel by 16 pixels: 16 x 16 = 256
256 pixels x 8 bit colour depth: 256 x 8 = 2048
Answer: Image 2 has a file size of 2048 bits

In practise images are much larges and the pixel density is much greater than the two example above.
Picture
IMAGE 3: Dimensions 1600 pixels x 1200 pixels : Bit Depth 24
Follow the same steps to calculate the file size of image 3, this time convert the file size from bits too Megabytes.
Step 1: Multiply the number of horizontal pixels by the number of vertical pixels: 1600 x 1200 = 1920000 pixels
Step 2: 
Multiply the total pixels used by the colour/bit depth: 1920000 x 24 = 46080000 bits
Step 3: 
Divide the answer from step 2 by 8 to give the number of bytes used: 46080000 / 8 = 5760000 bytes
Step 4: 
Divide the number of bytes used by 1024 to give the value in Kilobytes: 5760000 / 1024 = 5625 Kilobytes
Step 5:  Divide the number of kilobytes used by 1024 to give the value in Megabytes: 5625 / 1024 = 5.4 Megabytes
​

The original image 3 has a file size of 5.2Mb, this value excludes any metadata storage used and was the file size before being compressed for use over the internet
Picture
IMAGE SIZE
1: An image has the following properties:
  • Dimensions 1024 pixels x 575 pixels
  • Bit Depth 24
Calculate the image size, show your workings at each stage and display the result in Mb.

2: An image has the following properties:
  • Dimensions 12 inch x 11 inch
  • Bit Depth 16
  • 72 pixels per inch
Calculate the image size, show your workings at each stage and display the result in Mb.

3: Besides the size and bit depth of an image, what else could have an impact on the total file size?

4:Give two situation where reducing the file size of an image is needed, explain the impact of doing this.
Picture
NEXT: SOUND REPRESENTATION
Picture
SUGGESTIONS
We would love to hear from you
SUBSCRIBE 
To enjoy more benefits
We hope you find this site useful. If you notice any errors or would like to contribute material then please contact us.