SlideShare a Scribd company logo
Objectives:
• Image file representation
• Image file calculation
Image Representation
• Each box represent one pixel
• 8 X 8 bit map image
• Image size is 64
• Bitmap image -
• JPEG
• GIF ect…
Bitmap graphics: A bitmap file stores the position and color of every
pixel that makes up an image. The image is made of millions of pixels
and the color of each pixel is stored using a number code. A bitmap is a
good way to store photographs.
Vector graphics: A vector image is made up of shapes constructed from
lines. The computer stores mathematical formulas that tell it how to draw
shapes and lines. A vector file is smaller than a bitmap file. Vector
graphics are good for images made of simple lines and shapes, for
example, cartoons, diagrams, and graphs.
Images in digital form
• If a bitmap image is made larger, all the dots get
bigger and the image looks distorted. This is called
pixelation.
• Pixelation does not affect vector images, they are
drawn to the correct size using the stored
mathematical formulas
Pixelation
• Bitmap images are made up of a two-
dimension matrix of pixels.
• Each pixel is represented by a binary number.
• The bitmap image is stored as a series of
binary numbers
• A black and white image needs only one bit per
pixel (0 or 1)
• If each pixel is represented by 2 bits, then the
pixel can be one of these four colors. (22 = 4), 00,
01, 10, 11
Bitmap Images
Colour depth: The number of bits used to represent
each color is called bit depth
If 8-bit color depth means that each pixel can be one
of 256 colors ( 28 = 256)
Image resolution: Number of pixels that make up an
image.
• An increase in the image will increase the file size
Bitmap Images
Representation of Sound
• Each sound file has a wavelength, frequency,
and amplitude.
• Sound is analog, so sound waves need to be
sampled to be stored in the computer.
• Sampling means measuring the amplitude
of the sound wave. This is done by ADC.
• To convert analog data to digital, the sound
waves are sampled at regular time intervals.
Fundamentals of Sound
Sound Wave
• Sound is about vibration. Any sound requires a source, such as a
human voice or musical instrument, and a substance to travel
through
• These vibrations consist of the motion of particles back and forth,
knocking with each other and creating a sound wave: an
analogue signal that travels in the air.
Fundamentals of Sound
Amplitude or volume
• The amplitude is the intensity (or height) of the sound wave. It
relates to the amount of energy the wave carries and it is
measured in voltage (V).
• If calculated from the crest, it will have a positive peak of energy,
for example 10V
• If calculated from the trough, it will have a negative peak of
energy, for example -10V
Fundamentals of Sound
Time period (Duration)
A wave has a repeated pattern, and one completed repetition is
called a cycle (or frequency).
Time period is the time necessary to complete a cycle. A complete
cycle occurs when the sound wave passes between two consecutive
points. This can be:
• Two consecutive crests
• Two consecutive troughs
The formula for calculating the time to complete a cycle is:
Time period = 1 / frequency
Fundamentals of Sound
Frequency
• The frequency is the number of completed cycles per second of a
sound wave.
• To calculate the frequency of a sound wave, you need to calculate
the time it takes to complete one wave cycle. The unit used to
measure frequency is named hertz (Hz). One hertz is one cycle per
second.
•
• For example, a frequency of 1 hertz means that the wave has one
cycle per second.
Frequency
High-frequency waves appear close together and low-frequency waves appear
further apart.
Sampling sound
A technique used to convert a sound from analogue to digital is sampling.
While sampling a sound, the computer takes measurements of the analogue
signal at regular time intervals, and then a unique bit pattern of binary numbers is
assigned to each sample. After that, the digitised sound can be stored and
processed by a computer as a sequence of 1,1s and 0,0s.
Representation of Sound
Representation of Sound
Sample resolution: The number of bits per sample
is known as sample resolution (bit depth)
Sampling Rate (frequency): The number of
sound samples taken per second. This is measured
in hertz (Hz).
1 Hz = 1 sample per second
CDs have a 16-bit sampling resolution and a 4.1
kHz sample rate, that is 44100 Hz samples every
second. This gives high-quality sound.
Representation of Sound
Benefits and drawbacks of using large sampling
resolution when recording the sound
Image Calculation
File size = horizontal pixels × vertical pixels × bit depth
-------------------------------------------
8(to convert to bytes) × 1024 (kilobytes)
Bit Depth (Bits Per Pixel) Number of Colours or Tones Where do # of Colours Come
From?
1 2 21=2
2 4 22=4
3 8 23=8
4 16 24=16
6 64 26=64
8 256 28=256
Image File Calculation
A 500dpi image that measures 7 inches by 6 inches with the availability of
65,536 colours would result in the following calculation:
Exam Style Questions
How many bits per pixel would need to be
used if an image used 4 colours instead of 2?
2 bits
2 power 2 = 4
Exam Style Questions
The image below contain a black and white image consisting of 36 pixels.
Explain why 36 bits are needed to represent the pixels in the image .
Two colours needed in the image so two
possible bit pattens needed 36 pixeles so
36 bits needed
Exam Style Questions
A bitmapped image with a colour depth of
one can represent images that use two
colours.
How many more colours can be represeted
in an image if the colour depth is increased
from one to four?
14
16- 2 = 14
Exam Style Questions
State the minimum number of bits needed to
encode 32 different colours?
5 bits
Audio file Calculation
• Sample rate in Hz
• bit depth/ Bit Resolution
• Length
• Number of channels (mono /Stereo)
Sample rate Bit Resolution
11.025kHz 8 Bit
22.05. kHz 8 bit
44.1 kHz 16 bit
Sample rate X Bit Resolution X Time (seconds) X Channel
Audio file Size = ________________________________________________
8(to convert to bytes) × 1024 (kilobytes)
Audio File calculation
Bit Rate: Every second how many bits are taken in that audio. Bit rates are
usually measured in kilobits per second (kbps).
Bit rate = sample rate X bit resolution X Channels
----------------------------------------------------
1000
Audio File calculation
What if the audio is 1 Minute, with a 16 bit resolution and
44.1kHz with the stereo channel. What would be the file size?
Size =( 44.1 X 1000 X 16 X 60 X 2) / ( 8 X 1024 X 1024)
= 10.09 MB
Bit rate = 44100 X 16 X 2
------------------- = 1411.2 kbps
1000
Audio File calculation
Five minutes of music is sampled at 40000 samples per second, and
each sample is encoded into 16 bits(2 bytes). How big will the
resulting music file be?
5 minutes =300 seconds. So there are 300 X 40,000.
Each sample occupies 2 bytes, making a file size of
= 300 X 40000 X 2 bytes
= 24,000000 bytes
= 24 MB
Audio File calculation
Five minutes of music is sampled at 8000 samples per second,
and each sample is encoded into 16 bits(2 bytes). How big will
the resulting music file be?
File Compression
Lossless Compression
Breaking up the files into “smaller” form for
transmission or storage and then putting it back
together .
Example:
• Text Files
• ZIP files format
• UNIX tool GZIP G
• GIF
Lossy Compression
These programs simply eliminate "unnecessary" bits of
information, tailoring the file so that it is smaller. This type of
compression is used a lot for reducing the file size of bitmap
pictures, which tend to be fairly bulky.
Example:
• JPEG
• MP4
• MP3
An image is 3072 pixels by 2304. Calculate:
• The total number of pixels in the original image
• The number if bytes occupied by this file
• The file size of the jpeg image ( in MB) if the original image
was reduced by a factor of 5
• How many uncompressed file of the size calculated in
above could be stored on a 4 gigabyte memory card.
• How many compressed files of the size calculated above
could be store in 4 gigabyte memory card
Activity -1
Storage
size
Document / Spread
sheet
Database ( MS ACCESS)
1 Byte Single character in text
Whole number 0 to 255
Text data type
Whole number (-128 to +127) ---Number /
BYTE data type
Yes/ NO data type
2 byte A single character for a
large Asian character set
The whole number (-3200 to +3200) -----
Number/ Integer / Short data type
4 Byte Whole number between - 2
billion to +2 billion
Single precision/ Floating
point
Number/ Long Integer type
Number / Single data type (6 decimal digits)
8 bytes Double precisions Floating
Point (15 digits)
Massive whole numbers
Number / Double Data type
Date/Time Data type
Currency Data type
TEXT / Database file Size Calculations
Standard data types size:
Usually text files uses ASCII format. It code the text files in denary or
hexadecimal. (RLE – Run Length Encoding)
The phrase
“ THIS SECTION SHOWS YOU HOW THIS WORLD” 35
“1 SECTION S2S Y3 2 1 W3LD WORK” 23 mem ory units
Text File Compression
 Repeated word THIS is replaced as number 1
 HOW and OU is replaced as number 2 and 3
 Spaces are ignored and 33% of file size saved
 Text files uses the Lossless file compression.
Image File Compression – RLE
https://www.csfieldguide.org.nz/en/interactives/run-length-encoding/
https://www.dcode.fr/rle-compression#f1
RLE Calculator
Estimate the file size of the word document which contains 2000
characters and a small image which is 300 X 300 pixels in size with 8
colors. Assume an extra 20 KB for other document features.[4]
Characters = 2000 bytes
Image size = 300 X 300 X 3 = 270000 bits = 33750 bytes
Extra = 20 KB = 20480 bytes
Exercise - 1
File size = 2000 +33750 + 20480 = 56230 bytes = 54.9 KB
Or
= 2000 + 33750 + 20000 = 55750 / 1000 = 55. 7 KB
A database is to contain a person’s name and their address.
Decide the maximum number of characters you would need to input a
name and an address.
Estimate the maximum size of files needed to store the name and address.
Exercise - 2
A security system contain a password (16 characters long), a username(20
characters long), a small photo(256 X 640 pixels in size) and a security
questions ( up to 72 characters long). Estimate the file size needed to store
all this data
Exercise - 3
MIDI - Musical Instrument Digital Interface
MIDI files are not music and don’t contain any sounds
MIDI represents the information needed to recreate
a performance as many individual pieces of data.
MIDI is a communications protocol that allows
electronic sounds to interact with each other
MIDI Devices Devices that can be controlled with MIDI
include:
Keyboards
Synths
Effects units
MIDI Interface/Control Devices
Lighting Boards
Mixers
Computer Programs – computers
Fireworks
MIDI - Musical Instrument Digital Interface
MIDI - Musical Instrument Digital Interface
 MIDI Cable – 5 pin DIN
connectors
 MIDI Interface – Multiple inputs and outputs
which can digitally route MIDI Messages on
the fly, much like a patch bay.
 This is a typical
MIDI/Computer
setup.
 Additional devices can either be routed by the interface or
connected to the MIDI THRU of the preceding device.
 Devices can be directly routed to one another without the
need of a computer or interface
MIDI Setups
MIDI commands
• The fist byte is the status byte – Informs the MIDI device
what function to perform.
• MIDI has 16 channels( 0 to 15)
• Pitch Byte – tells which byte to play)
• Velocity Byte – tells how loud to play notes
• Note on/off - tells that a key has been pressed/released
• Key pressure - tells how loudness of the music note
Sequencer Software is needed to play back
the MIDI files in any instrument.
MIDI files may be converted to MP3, WAV,
WMA, FLAC, OGG, AAC, MPC on any
Windows platform using Total Audio
Converter
MIDI
Upload
Uploading means data is being sent from
your computer to the internet
Example :
• Sending Email
• Positng photos on social
media
• Using webcam
Download
Downloading means data your computer is
receiving data from the Internet the internet
Example :
• opening webpage
• Receiving email
• Purchasing any files
• Watching online videos
A company which offers the following Internet broadband
transfer rates:
• 56 megabits per second DOWNLOAD
• 16 megabits per second UPLOAD
If each music track is 3.5 megabytes in size, how long
would it take Juan to download his 40 tracks?
40 tracks = 40 X 3.5 = 140 MB
56 megabits/sec = 7 Mbyte/sec
Time take to download the tracks = 140/7
= 20 Seconds
Dima has agreed to send Michaela a 20 megabyte file. They both have a broadband
connection. Dima has to upload his file to a server and then Michaela needs to
download it from the same server. The broadband data transfer rates (speeds) are:
1 megabits per second to upload a file
8 megabits per second to download a file
(Note: 8 bits = 1 byte)
a. How long does it take to upload Dima’s file?
b. How long does it take to download Dima’s file?
A company advertises its Internet broadband speeds as follows:
• download speed of 128 megabits per second
• upload speed of 16 megabits per second (8 bits = 1 byte)
a) Explain what is meant by the two terms download speed and
upload speed
(b) How many 4-megabyte files could be downloaded per second
using this company’s broadband
David has a photo that is 2MB. How many of these can he store
on his 3GB memory stick?
3 * 1000 = 3000
3000 / 2 = 1500
Number the data storage units from 1 (smallest) to 9 (largest).
The first one has been done for you.

More Related Content

Similar to Unit1_File Size Calculation.pptx

add9.5.ppt
add9.5.pptadd9.5.ppt
add9.5.ppt
AshenafiGirma5
 
Digital Transmission Fundamentals
Digital Transmission FundamentalsDigital Transmission Fundamentals
Digital Transmission FundamentalsAisu
 
Multimedia
MultimediaMultimedia
Multimedia
MR Z
 
Digital Image Processing and gis software systems
Digital Image Processing and gis software systemsDigital Image Processing and gis software systems
Digital Image Processing and gis software systems
Nirmal Kumar
 
Digital Electronics for Audio
Digital Electronics for AudioDigital Electronics for Audio
Digital Electronics for Audio
jazztothebone
 
fundamentals of digital imaging - POONAM.pptx
fundamentals of digital imaging - POONAM.pptxfundamentals of digital imaging - POONAM.pptx
fundamentals of digital imaging - POONAM.pptx
PoonamRijal
 
Graphics Primitives and CG Display Devices
Graphics Primitives and CG Display DevicesGraphics Primitives and CG Display Devices
Graphics Primitives and CG Display Devices
DIPIKA83
 
Digital audio
Digital audioDigital audio
Digital audio
Gem WeBlog
 
Audio encoding principles
Audio encoding principlesAudio encoding principles
Audio encoding principles
Phillip Doyle
 
Tools for Information Processes: Organising
Tools for Information Processes: OrganisingTools for Information Processes: Organising
Tools for Information Processes: Organising
Kelly Bauer
 
Chapter 02 audio recording - part i
Chapter 02   audio recording - part iChapter 02   audio recording - part i
Chapter 02 audio recording - part iNazihah Ahwan
 
Presentation1.pptx
Presentation1.pptxPresentation1.pptx
Presentation1.pptx
kiarambelele
 
Data Representation in Computers
Data Representation in ComputersData Representation in Computers
Data Representation in Computers
Sajitha Pathirana
 
Analog to digital conversion
Analog to digital conversionAnalog to digital conversion
Analog to digital conversion
DJShirlee
 
Week 4 LBSC 690 Information Technology
Week 4 LBSC 690 Information TechnologyWeek 4 LBSC 690 Information Technology
Week 4 LBSC 690 Information TechnologyVideoguy
 
Digital Audio in Multimedia
Digital Audio in MultimediaDigital Audio in Multimedia
Digital Audio in Multimedia
lalithambiga kamaraj
 
A1mpeg12 2004
A1mpeg12 2004A1mpeg12 2004
A1mpeg12 2004
Thiago Skiba
 
Chapter Seven
Chapter SevenChapter Seven
Chapter Seven
Nada G.Youssef
 

Similar to Unit1_File Size Calculation.pptx (20)

add9.5.ppt
add9.5.pptadd9.5.ppt
add9.5.ppt
 
Digital Transmission Fundamentals
Digital Transmission FundamentalsDigital Transmission Fundamentals
Digital Transmission Fundamentals
 
Multimedia
MultimediaMultimedia
Multimedia
 
Digital Image Processing and gis software systems
Digital Image Processing and gis software systemsDigital Image Processing and gis software systems
Digital Image Processing and gis software systems
 
Digital Electronics for Audio
Digital Electronics for AudioDigital Electronics for Audio
Digital Electronics for Audio
 
fundamentals of digital imaging - POONAM.pptx
fundamentals of digital imaging - POONAM.pptxfundamentals of digital imaging - POONAM.pptx
fundamentals of digital imaging - POONAM.pptx
 
Graphics Primitives and CG Display Devices
Graphics Primitives and CG Display DevicesGraphics Primitives and CG Display Devices
Graphics Primitives and CG Display Devices
 
Digital audio
Digital audioDigital audio
Digital audio
 
Soundpres
SoundpresSoundpres
Soundpres
 
Audio encoding principles
Audio encoding principlesAudio encoding principles
Audio encoding principles
 
Tools for Information Processes: Organising
Tools for Information Processes: OrganisingTools for Information Processes: Organising
Tools for Information Processes: Organising
 
Chapter 02 audio recording - part i
Chapter 02   audio recording - part iChapter 02   audio recording - part i
Chapter 02 audio recording - part i
 
Presentation1.pptx
Presentation1.pptxPresentation1.pptx
Presentation1.pptx
 
Data Representation in Computers
Data Representation in ComputersData Representation in Computers
Data Representation in Computers
 
Analog to digital conversion
Analog to digital conversionAnalog to digital conversion
Analog to digital conversion
 
Week 4 LBSC 690 Information Technology
Week 4 LBSC 690 Information TechnologyWeek 4 LBSC 690 Information Technology
Week 4 LBSC 690 Information Technology
 
Digital Audio in Multimedia
Digital Audio in MultimediaDigital Audio in Multimedia
Digital Audio in Multimedia
 
Mm Unit 3
Mm Unit 3Mm Unit 3
Mm Unit 3
 
A1mpeg12 2004
A1mpeg12 2004A1mpeg12 2004
A1mpeg12 2004
 
Chapter Seven
Chapter SevenChapter Seven
Chapter Seven
 

Recently uploaded

The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
Col Mukteshwar Prasad
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 

Recently uploaded (20)

The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 

Unit1_File Size Calculation.pptx

  • 1. Objectives: • Image file representation • Image file calculation
  • 2. Image Representation • Each box represent one pixel • 8 X 8 bit map image • Image size is 64 • Bitmap image - • JPEG • GIF ect…
  • 3. Bitmap graphics: A bitmap file stores the position and color of every pixel that makes up an image. The image is made of millions of pixels and the color of each pixel is stored using a number code. A bitmap is a good way to store photographs. Vector graphics: A vector image is made up of shapes constructed from lines. The computer stores mathematical formulas that tell it how to draw shapes and lines. A vector file is smaller than a bitmap file. Vector graphics are good for images made of simple lines and shapes, for example, cartoons, diagrams, and graphs. Images in digital form
  • 4. • If a bitmap image is made larger, all the dots get bigger and the image looks distorted. This is called pixelation. • Pixelation does not affect vector images, they are drawn to the correct size using the stored mathematical formulas Pixelation
  • 5. • Bitmap images are made up of a two- dimension matrix of pixels. • Each pixel is represented by a binary number. • The bitmap image is stored as a series of binary numbers • A black and white image needs only one bit per pixel (0 or 1) • If each pixel is represented by 2 bits, then the pixel can be one of these four colors. (22 = 4), 00, 01, 10, 11 Bitmap Images
  • 6. Colour depth: The number of bits used to represent each color is called bit depth If 8-bit color depth means that each pixel can be one of 256 colors ( 28 = 256) Image resolution: Number of pixels that make up an image. • An increase in the image will increase the file size Bitmap Images
  • 7. Representation of Sound • Each sound file has a wavelength, frequency, and amplitude. • Sound is analog, so sound waves need to be sampled to be stored in the computer. • Sampling means measuring the amplitude of the sound wave. This is done by ADC. • To convert analog data to digital, the sound waves are sampled at regular time intervals.
  • 8. Fundamentals of Sound Sound Wave • Sound is about vibration. Any sound requires a source, such as a human voice or musical instrument, and a substance to travel through • These vibrations consist of the motion of particles back and forth, knocking with each other and creating a sound wave: an analogue signal that travels in the air.
  • 9. Fundamentals of Sound Amplitude or volume • The amplitude is the intensity (or height) of the sound wave. It relates to the amount of energy the wave carries and it is measured in voltage (V). • If calculated from the crest, it will have a positive peak of energy, for example 10V • If calculated from the trough, it will have a negative peak of energy, for example -10V
  • 10. Fundamentals of Sound Time period (Duration) A wave has a repeated pattern, and one completed repetition is called a cycle (or frequency). Time period is the time necessary to complete a cycle. A complete cycle occurs when the sound wave passes between two consecutive points. This can be: • Two consecutive crests • Two consecutive troughs The formula for calculating the time to complete a cycle is: Time period = 1 / frequency
  • 11. Fundamentals of Sound Frequency • The frequency is the number of completed cycles per second of a sound wave. • To calculate the frequency of a sound wave, you need to calculate the time it takes to complete one wave cycle. The unit used to measure frequency is named hertz (Hz). One hertz is one cycle per second. • • For example, a frequency of 1 hertz means that the wave has one cycle per second.
  • 12. Frequency High-frequency waves appear close together and low-frequency waves appear further apart.
  • 13. Sampling sound A technique used to convert a sound from analogue to digital is sampling. While sampling a sound, the computer takes measurements of the analogue signal at regular time intervals, and then a unique bit pattern of binary numbers is assigned to each sample. After that, the digitised sound can be stored and processed by a computer as a sequence of 1,1s and 0,0s.
  • 15. Representation of Sound Sample resolution: The number of bits per sample is known as sample resolution (bit depth) Sampling Rate (frequency): The number of sound samples taken per second. This is measured in hertz (Hz). 1 Hz = 1 sample per second CDs have a 16-bit sampling resolution and a 4.1 kHz sample rate, that is 44100 Hz samples every second. This gives high-quality sound.
  • 16. Representation of Sound Benefits and drawbacks of using large sampling resolution when recording the sound
  • 17. Image Calculation File size = horizontal pixels × vertical pixels × bit depth ------------------------------------------- 8(to convert to bytes) × 1024 (kilobytes) Bit Depth (Bits Per Pixel) Number of Colours or Tones Where do # of Colours Come From? 1 2 21=2 2 4 22=4 3 8 23=8 4 16 24=16 6 64 26=64 8 256 28=256
  • 18. Image File Calculation A 500dpi image that measures 7 inches by 6 inches with the availability of 65,536 colours would result in the following calculation:
  • 19. Exam Style Questions How many bits per pixel would need to be used if an image used 4 colours instead of 2? 2 bits 2 power 2 = 4
  • 20. Exam Style Questions The image below contain a black and white image consisting of 36 pixels. Explain why 36 bits are needed to represent the pixels in the image . Two colours needed in the image so two possible bit pattens needed 36 pixeles so 36 bits needed
  • 21. Exam Style Questions A bitmapped image with a colour depth of one can represent images that use two colours. How many more colours can be represeted in an image if the colour depth is increased from one to four? 14 16- 2 = 14
  • 22. Exam Style Questions State the minimum number of bits needed to encode 32 different colours? 5 bits
  • 23. Audio file Calculation • Sample rate in Hz • bit depth/ Bit Resolution • Length • Number of channels (mono /Stereo) Sample rate Bit Resolution 11.025kHz 8 Bit 22.05. kHz 8 bit 44.1 kHz 16 bit Sample rate X Bit Resolution X Time (seconds) X Channel Audio file Size = ________________________________________________ 8(to convert to bytes) × 1024 (kilobytes)
  • 24. Audio File calculation Bit Rate: Every second how many bits are taken in that audio. Bit rates are usually measured in kilobits per second (kbps). Bit rate = sample rate X bit resolution X Channels ---------------------------------------------------- 1000
  • 25. Audio File calculation What if the audio is 1 Minute, with a 16 bit resolution and 44.1kHz with the stereo channel. What would be the file size? Size =( 44.1 X 1000 X 16 X 60 X 2) / ( 8 X 1024 X 1024) = 10.09 MB Bit rate = 44100 X 16 X 2 ------------------- = 1411.2 kbps 1000
  • 26. Audio File calculation Five minutes of music is sampled at 40000 samples per second, and each sample is encoded into 16 bits(2 bytes). How big will the resulting music file be? 5 minutes =300 seconds. So there are 300 X 40,000. Each sample occupies 2 bytes, making a file size of = 300 X 40000 X 2 bytes = 24,000000 bytes = 24 MB
  • 27. Audio File calculation Five minutes of music is sampled at 8000 samples per second, and each sample is encoded into 16 bits(2 bytes). How big will the resulting music file be?
  • 29. Lossless Compression Breaking up the files into “smaller” form for transmission or storage and then putting it back together . Example: • Text Files • ZIP files format • UNIX tool GZIP G • GIF
  • 30. Lossy Compression These programs simply eliminate "unnecessary" bits of information, tailoring the file so that it is smaller. This type of compression is used a lot for reducing the file size of bitmap pictures, which tend to be fairly bulky. Example: • JPEG • MP4 • MP3
  • 31. An image is 3072 pixels by 2304. Calculate: • The total number of pixels in the original image • The number if bytes occupied by this file • The file size of the jpeg image ( in MB) if the original image was reduced by a factor of 5 • How many uncompressed file of the size calculated in above could be stored on a 4 gigabyte memory card. • How many compressed files of the size calculated above could be store in 4 gigabyte memory card Activity -1
  • 32. Storage size Document / Spread sheet Database ( MS ACCESS) 1 Byte Single character in text Whole number 0 to 255 Text data type Whole number (-128 to +127) ---Number / BYTE data type Yes/ NO data type 2 byte A single character for a large Asian character set The whole number (-3200 to +3200) ----- Number/ Integer / Short data type 4 Byte Whole number between - 2 billion to +2 billion Single precision/ Floating point Number/ Long Integer type Number / Single data type (6 decimal digits) 8 bytes Double precisions Floating Point (15 digits) Massive whole numbers Number / Double Data type Date/Time Data type Currency Data type TEXT / Database file Size Calculations Standard data types size:
  • 33. Usually text files uses ASCII format. It code the text files in denary or hexadecimal. (RLE – Run Length Encoding) The phrase “ THIS SECTION SHOWS YOU HOW THIS WORLD” 35 “1 SECTION S2S Y3 2 1 W3LD WORK” 23 mem ory units Text File Compression  Repeated word THIS is replaced as number 1  HOW and OU is replaced as number 2 and 3  Spaces are ignored and 33% of file size saved  Text files uses the Lossless file compression.
  • 34. Image File Compression – RLE https://www.csfieldguide.org.nz/en/interactives/run-length-encoding/ https://www.dcode.fr/rle-compression#f1 RLE Calculator
  • 35. Estimate the file size of the word document which contains 2000 characters and a small image which is 300 X 300 pixels in size with 8 colors. Assume an extra 20 KB for other document features.[4] Characters = 2000 bytes Image size = 300 X 300 X 3 = 270000 bits = 33750 bytes Extra = 20 KB = 20480 bytes Exercise - 1 File size = 2000 +33750 + 20480 = 56230 bytes = 54.9 KB Or = 2000 + 33750 + 20000 = 55750 / 1000 = 55. 7 KB
  • 36. A database is to contain a person’s name and their address. Decide the maximum number of characters you would need to input a name and an address. Estimate the maximum size of files needed to store the name and address. Exercise - 2
  • 37. A security system contain a password (16 characters long), a username(20 characters long), a small photo(256 X 640 pixels in size) and a security questions ( up to 72 characters long). Estimate the file size needed to store all this data Exercise - 3
  • 38. MIDI - Musical Instrument Digital Interface MIDI files are not music and don’t contain any sounds MIDI represents the information needed to recreate a performance as many individual pieces of data. MIDI is a communications protocol that allows electronic sounds to interact with each other
  • 39. MIDI Devices Devices that can be controlled with MIDI include: Keyboards Synths Effects units MIDI Interface/Control Devices Lighting Boards Mixers Computer Programs – computers Fireworks MIDI - Musical Instrument Digital Interface
  • 40. MIDI - Musical Instrument Digital Interface  MIDI Cable – 5 pin DIN connectors  MIDI Interface – Multiple inputs and outputs which can digitally route MIDI Messages on the fly, much like a patch bay.
  • 41.  This is a typical MIDI/Computer setup.  Additional devices can either be routed by the interface or connected to the MIDI THRU of the preceding device.  Devices can be directly routed to one another without the need of a computer or interface MIDI Setups
  • 42. MIDI commands • The fist byte is the status byte – Informs the MIDI device what function to perform. • MIDI has 16 channels( 0 to 15) • Pitch Byte – tells which byte to play) • Velocity Byte – tells how loud to play notes • Note on/off - tells that a key has been pressed/released • Key pressure - tells how loudness of the music note
  • 43. Sequencer Software is needed to play back the MIDI files in any instrument. MIDI files may be converted to MP3, WAV, WMA, FLAC, OGG, AAC, MPC on any Windows platform using Total Audio Converter MIDI
  • 44. Upload Uploading means data is being sent from your computer to the internet Example : • Sending Email • Positng photos on social media • Using webcam
  • 45. Download Downloading means data your computer is receiving data from the Internet the internet Example : • opening webpage • Receiving email • Purchasing any files • Watching online videos
  • 46. A company which offers the following Internet broadband transfer rates: • 56 megabits per second DOWNLOAD • 16 megabits per second UPLOAD If each music track is 3.5 megabytes in size, how long would it take Juan to download his 40 tracks? 40 tracks = 40 X 3.5 = 140 MB 56 megabits/sec = 7 Mbyte/sec Time take to download the tracks = 140/7 = 20 Seconds
  • 47. Dima has agreed to send Michaela a 20 megabyte file. They both have a broadband connection. Dima has to upload his file to a server and then Michaela needs to download it from the same server. The broadband data transfer rates (speeds) are: 1 megabits per second to upload a file 8 megabits per second to download a file (Note: 8 bits = 1 byte) a. How long does it take to upload Dima’s file? b. How long does it take to download Dima’s file?
  • 48. A company advertises its Internet broadband speeds as follows: • download speed of 128 megabits per second • upload speed of 16 megabits per second (8 bits = 1 byte) a) Explain what is meant by the two terms download speed and upload speed (b) How many 4-megabyte files could be downloaded per second using this company’s broadband
  • 49. David has a photo that is 2MB. How many of these can he store on his 3GB memory stick? 3 * 1000 = 3000 3000 / 2 = 1500
  • 50. Number the data storage units from 1 (smallest) to 9 (largest). The first one has been done for you.