Pixels, Colour Depth and File Size

4 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$69.99
List Price:  $99.99
You save:  $30
€64.56
List Price:  €92.23
You save:  €27.67
£55.01
List Price:  £78.59
You save:  £23.58
CA$96.01
List Price:  CA$137.16
You save:  CA$41.15
A$105.78
List Price:  A$151.13
You save:  A$45.34
S$94.50
List Price:  S$135.01
You save:  S$40.50
HK$546.82
List Price:  HK$781.20
You save:  HK$234.38
CHF 64.02
List Price:  CHF 91.46
You save:  CHF 27.44
NOK kr743.24
List Price:  NOK kr1,061.82
You save:  NOK kr318.58
DKK kr481.69
List Price:  DKK kr688.17
You save:  DKK kr206.47
NZ$114.53
List Price:  NZ$163.63
You save:  NZ$49.09
د.إ257.07
List Price:  د.إ367.26
You save:  د.إ110.19
৳8,236.66
List Price:  ৳11,767.17
You save:  ৳3,530.50
₹5,817.67
List Price:  ₹8,311.31
You save:  ₹2,493.64
RM329.75
List Price:  RM471.10
You save:  RM141.34
₦101,485.50
List Price:  ₦144,985.50
You save:  ₦43,500
₨19,541.46
List Price:  ₨27,917.57
You save:  ₨8,376.10
฿2,567.54
List Price:  ฿3,668.07
You save:  ฿1,100.53
₺2,256.81
List Price:  ₺3,224.15
You save:  ₺967.34
B$360.07
List Price:  B$514.41
You save:  B$154.34
R1,286.74
List Price:  R1,838.28
You save:  R551.54
Лв126.27
List Price:  Лв180.40
You save:  Лв54.12
₩95,598.53
List Price:  ₩136,575.19
You save:  ₩40,976.65
₪256.95
List Price:  ₪367.08
You save:  ₪110.13
₱4,074.18
List Price:  ₱5,820.51
You save:  ₱1,746.33
¥10,986.96
List Price:  ¥15,696.33
You save:  ¥4,709.37
MX$1,168.64
List Price:  MX$1,669.55
You save:  MX$500.91
QR256.05
List Price:  QR365.81
You save:  QR109.75
P949.66
List Price:  P1,356.72
You save:  P407.05
KSh9,273.67
List Price:  KSh13,248.67
You save:  KSh3,975
E£3,300.12
List Price:  E£4,714.66
You save:  E£1,414.54
ብር4,034.35
List Price:  ብር5,763.61
You save:  ብር1,729.25
Kz59,523.20
List Price:  Kz85,036.79
You save:  Kz25,513.59
CLP$63,672
List Price:  CLP$90,963.90
You save:  CLP$27,291.90
CN¥497.62
List Price:  CN¥710.91
You save:  CN¥213.29
RD$4,127.47
List Price:  RD$5,896.64
You save:  RD$1,769.17
DA9,410.85
List Price:  DA13,444.65
You save:  DA4,033.79
FJ$158.71
List Price:  FJ$226.74
You save:  FJ$68.02
Q545.60
List Price:  Q779.46
You save:  Q233.86
GY$14,698.27
List Price:  GY$20,998.43
You save:  GY$6,300.16
ISK kr9,664.91
List Price:  ISK kr13,807.61
You save:  ISK kr4,142.70
DH698.43
List Price:  DH997.80
You save:  DH299.37
L1,241.62
List Price:  L1,773.82
You save:  L532.20
ден3,987.30
List Price:  ден5,696.40
You save:  ден1,709.09
MOP$564.71
List Price:  MOP$806.77
You save:  MOP$242.05
N$1,285.96
List Price:  N$1,837.16
You save:  N$551.20
C$2,584.60
List Price:  C$3,692.45
You save:  C$1,107.84
रु9,349.97
List Price:  रु13,357.68
You save:  रु4,007.70
S/262.08
List Price:  S/374.42
You save:  S/112.33
K272.89
List Price:  K389.87
You save:  K116.97
SAR262.50
List Price:  SAR375.02
You save:  SAR112.51
ZK1,859.01
List Price:  ZK2,655.84
You save:  ZK796.83
L321.09
List Price:  L458.72
You save:  L137.63
Kč1,596.60
List Price:  Kč2,280.96
You save:  Kč684.35
Ft24,869.15
List Price:  Ft35,528.88
You save:  Ft10,659.73
SEK kr749.47
List Price:  SEK kr1,070.73
You save:  SEK kr321.25
ARS$62,310.03
List Price:  ARS$89,018.15
You save:  ARS$26,708.11
Bs485.20
List Price:  Bs693.17
You save:  Bs207.97
COP$268,127.80
List Price:  COP$383,056.14
You save:  COP$114,928.33
₡36,004.57
List Price:  ₡51,437.31
You save:  ₡15,432.73
L1,735.35
List Price:  L2,479.18
You save:  L743.82
₲528,059.90
List Price:  ₲754,403.63
You save:  ₲226,343.72
$U2,693.41
List Price:  $U3,847.90
You save:  $U1,154.48
zł275
List Price:  zł392.87
You save:  zł117.87
Already have an account? Log In

Transcript

Pixels, color depth and file size. When calculating the file size for an image, you need to know how many pixels are being used, which is the resolution and also the color depth. The color depth is the amount of bits that have been used to describe each pixel. The amount of bits that you have per pixel will dictate how many colors you can represent. As all items are represented in binary, each color will need its own unique code. Therefore, if you can only use one bit per pixel, you can only represent two numbers zero and one and therefore only two different colors.

If you have two bits per pixel, you can represent four different numbers 012 and three, and therefore four different colors. The more bits you have per pixel, the greater the color range you're able to represent. Most photo use 24 bits, eight for each of blue, green and red channel. knows, this allows for over 16 million colors to be represented and is known as true color. On this slide, we can see an example of how the different number of bits affects the different number of colors that you're able to represent. Take a moment to familiarize yourself with the table as you will need this in the following questions.

Here we have an example question. The image has a resolution of 100 pixels by 100 pixels, and it is using 16 different colors. What would the file size be in bytes? The first thing we need to work out is how many pixels there are in total, we have 100 rows 100 pixels. So we can work out the resolution by doing 100 times 100. This gives us a total of 10,000 pixels.

We then need to work out how many bits per pixel we're going to be using. The question states that we're going to need to represent 16 different colors purple pixel from the previous table, we can tell that to do that we need four bits. So we will therefore have four bits per pixel. We are now in a position to calculate the size of the file. We do this by multiplying the number of pixels, which was 10,000 by how many bits we're using per pixel, which is four. So 10,000 times four gives us 40,000 bits in total.

Finally, the question asks us to transfer this into bytes. To do this, we need to remember that there are eight bits in a byte. So to go from bits bytes, we need to divide by 840 thousand divided by eight gives us 5000 bytes for the size of this image file. Now it's your turn to have a go. We have an image that is 50 pixels by 100 pixels, and it is using eight different colors per pixel. work out what the file size would be in bytes.

Use the previous slide in reference, if you need to pause the video watch to work it out. So the resolution is going to be 50 times 100, which is 5000 pixels. We're using eight colors per pixel, which requires three bits. So the final calculation is going to be 5000 times three, which is 15,000 bits. And then to convert that to bytes, we're going to divide by 815 thousand divided by eight equals 1875 bytes. Another example for you to try again, pause the video whilst you're working out.

In this example, we have an image that is 500 pixels by 500 pixels, and it's using 64 different colors per pixel. So to work out the total number of pixels, we do 500 times 500, which gives us 250,000 64 colors can be represented with six bits. So to work out the total number of bits, we do 250,000 multiplied by six, which gives us a total of 1,500,000 bits. We now need to convert that into bytes. So to do that we divide by eight 1,500,000 divided by eight is 187,500 bytes. And to go from bytes to kilobytes, we divide by 1180 7500 divided by 1000 gives us 187.5 kilobytes

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.