SlideShare a Scribd company logo
1 of 9
Download to read offline
Lecture 2: Image types and formats
Computer Vision In MATLAB
By. Assist. Prof. Ielaf O.Abdul Majjed
2022-2023
Concept of Bits Per Pixel
bits per pixel (BPP) denotes the number of bits per pixel. The number of different colors in an image is depends
on the depth of color or bits per pixel. f we devise a formula for the calculation of total number of combinations
that can be made from bit, it would be like this.
Put 1 in the formula you get 2, put 2 in the formula, you get 4. It grows exponentially.
Bits per
pixel
Number of colors
1 bpp 2 colors
2 bpp 4 colors
3 bpp 8 colors
4 bpp 16 colors
5 bpp 32 colors
6 bpp 64 colors
7 bpp 128 colors
8 bpp 256 colors
10 bpp 1024 colors
16 bpp 65536 colors
24 bpp 16777216 colors (16.7 million colors)
32 bpp 4294967296 colors (4294 million colors)
This table shows different BPP and the amount of color they contain.
In case of 1 bpp, 0 denotes black, and 1 denotes white.
In case 8 bpp, 0 denotes black, and 255 denotes white.
The size of an image depends upon three things.
 Number of rows
 Number of columns
 Number of bits per pixel
The formula for calculating the size is Size of an image = rows * cols * bpp
Image storage requirements
Assuming it has 1024 rows and it has 1024 columns. And since it is a gray scale image, it has 256 different
shades of gray or it has bits per pixel. Then putting these values in the formula, we get
Size of an image = rows * cols * bpp
= 1024 * 1024 * 8
= 8388608 bits.
But since its not a standard answer that we recognize, so will convert it into our format.
Converting it into bytes = 8388608 / 8 = 1048576 bytes.
Converting into kilo bytes = 1048576 / 1024 = 1024kb.
Converting into Mega bytes = 1024 / 1024 = 1 Mb.
If you are given the size of the image and the bpp, you can also compute the rows and columns of a
square image using the formula (same rows and same column).
The distribution of colors within images may take numerous forms.
Type of an Image
1.BINARY IMAGE: The binary image as its name suggests, contain only two pixel
elements 0 & 1,where 0 refers to black and 1 refers to white. This image is also
known as Monochrome or bi-level image.
For converting an image into a binary image must choose a threshold value:
If f(x,y) in Image is greater than or equal to the threshold, Then set f(x,y) = 255
If f(x,y) is less than to the threshold Then set f(x,y)=0.
2. GRAY LEVEL (SCALE) 8 BIT COLOR FORMAT
8 bit color format is one of the most famous image format Each pixel is
represented by a single byte(8bit). It has 256 different shades of colors in it. It is
commonly known as Grayscale image. The range of the colors in 8 bit vary from
0-255. Where 0 stands for black, and 255 stands for white, and 127 stands for
gray color. Requires Color Look-Up Tables (LUTs) – Palette where the value of R
& G & B in (LUTs) are equal.
3. COLOR IMAGES
• 8 bit color image (index color).
• 16 bit Hicolor.
• 24 bit color image.
• 23 bit color image.
8 bit color image (index color).
 Each pixel used 8-bits to indicate the desired color. This number is then used as an index into
a hardware table called the color palette that contains 256 entries, each holding a 24-bit RGB
value. This is called indexed color.
 This technique is also called pseudocolor.
 Since humans are more sensitive to R and G than to B, we could use 3 bits for R and G,and 2
bits for B in index color.
 Requires Color Look-Up Tables (LUTs) – Palette.
16-bit Hicolor images
 The hicolor which uses 16 bits per pixel (5 R, 6 G, 5 B or 5 for each with 1 bit unused or 6R, 6G ,4B).
 The maximum number of colors in 16 bit color image is 216 Color.
 The palette does not affect the images.
24-bit color image
 In a 24-bit color image, each pixel is represented by three bytes, usually representing RGB.
 The maximum number of colors in 24bit color image is 224 or (16,777,216).
 Such graphics are referred to as “True Color" images, or just as "24-bit"graphics.
 If the browser is in 24-bit display, the palette does not affect the images.
32-bit color images
 The 32-bit color images are actually stored as 32-bit (RGBA) images, with the extra byte of data
for each pixel used to store an alpha value representing special effect information
 If the browser is in 32-bit display, the palette does not affect the images.
 Each pixel is represented by four byte(32bit).
All the colors here are of the 24 bit format, that means each color has 8 bits of red, 8 bits of green, 8 bits of
blue, in it. Or we can say each color has three different portions. You just have to change the quantity of these
three portions to make any color.
Binary color format
Color: Black Decimal Code: (0,0,0)
if we have to make a pure black color, we have to make all the three portion of R, G, B to 0.
Color: White Decimal Code: (255,255,255)
Color: Red Decimal Code: (255,0,0)
Color: Green Decimal Code: (0,255,0)
Color: Blue Decimal Code: (0,0,255)
Color: Gray Decimal Code:(128,128,128)
H.W.
1- Convert color images to gray using the equation and then using RGB2gray.
2- Zooming image.
Different color codes
Image Formats
Image Format describes how data related to the image will be stored. Data can be stored in compressed,
Uncompressed or vector format. Each format of the image have a different advantage and disadvantage.
Image types such a TIFF are good for printing while JPG or PNG, are best for web.
Many image formats adhere to the following simple model:
 Header
 Data (line by line, no breaks between lines).
Header contains at least: A signature or “magic number” (i.e. a short sequence of bytes for identifying
the file format) and the width and height of the image.
 TIFF(.tif, .tiff) Tagged Image File Format this format store image data without losing any data. It do
not perform any compression on images have a high-quality image is obtained but size of image is
also large, which is good for printing, professional printing.
 JPEG (.jpg, .jpeg) Joint Photographic Experts Group is a loss-prone (lossy) format in which data
is lost to reduce size of image. Due to compression, some data is lost but that loss is very less. It is a
very common format and are good for digital cameras, nonprofessional prints, E-Mail, Powerpoint
etc., making it ideal for web use.
 GIF (.gif) Graphics Interchange Format files are used for web graphics. They can be animated and
are limited to only 256 colors, can allow for transparency. GIF files are typically small is size and are
portable.
 PNG (.png) Portable Network Graphics files are a lossless image format. It was designed to
replace gif format as gif supported 256 colors unlike PNG which support 16 million colors.
 Bitmap (.bmp) Bit Map Image file is developed by Microsoft for windows. It is same as TIFF due
lossless, no compression property. Due to BMP being a proprietary format, it is generally
recommended to use TIFF files.
 EPS (.eps) Encapsulated PostScript file is a common vector file type. EPS files can be opened in
applications such as Adobe Illustrator or CorelDRAW.
 RAW Image Files (.raw, .cr2, .nef, .orf, .sr2) These Files are unprocessed created by a camera or
scanner. Many digital SLR cameras can shoot in RAW, whether it be a .raw, .cr2, or .nef. These
images are the equivalent of a digital negative, meaning that they hold a lot of image information.
These images need to be processed in an editor such as Adobe Photoshop or Lightroom. It saves
metadata and is used for photography.

More Related Content

Similar to Lecture 2-2023.pdf

Similar to Lecture 2-2023.pdf (20)

//STEIM Workshop: A Vernacular of File Formats
//STEIM Workshop: A Vernacular of File Formats//STEIM Workshop: A Vernacular of File Formats
//STEIM Workshop: A Vernacular of File Formats
 
Unit iv graphics
Unit iv  graphicsUnit iv  graphics
Unit iv graphics
 
Bitmap vector2
Bitmap vector2Bitmap vector2
Bitmap vector2
 
Technical concepts for graphic design production 4
Technical concepts for graphic design production 4Technical concepts for graphic design production 4
Technical concepts for graphic design production 4
 
Chapter 3 data representations
Chapter 3 data representationsChapter 3 data representations
Chapter 3 data representations
 
Chap9 10
Chap9 10Chap9 10
Chap9 10
 
Image formats and codecs
Image formats and codecsImage formats and codecs
Image formats and codecs
 
Chapter-1.pptx
Chapter-1.pptxChapter-1.pptx
Chapter-1.pptx
 
Graphics
GraphicsGraphics
Graphics
 
P1.1
P1.1 P1.1
P1.1
 
Graphics
GraphicsGraphics
Graphics
 
Chap46
Chap46Chap46
Chap46
 
Unit ii
Unit iiUnit ii
Unit ii
 
Multimedia digital images
 Multimedia  digital images Multimedia  digital images
Multimedia digital images
 
Sec 2.pptx
Sec 2.pptxSec 2.pptx
Sec 2.pptx
 
Sec 2.pdf
Sec 2.pdfSec 2.pdf
Sec 2.pdf
 
CLASS 1.1.pptx
CLASS 1.1.pptxCLASS 1.1.pptx
CLASS 1.1.pptx
 
Graphic Concepts
Graphic ConceptsGraphic Concepts
Graphic Concepts
 
New Computer Systems
New Computer SystemsNew Computer Systems
New Computer Systems
 
Learning&Teaching Systems Ppt
Learning&Teaching Systems PptLearning&Teaching Systems Ppt
Learning&Teaching Systems Ppt
 

More from ssuserff72e4

Lecture 6-2023.pdf
Lecture 6-2023.pdfLecture 6-2023.pdf
Lecture 6-2023.pdfssuserff72e4
 
Lecture 5-2023.pdf
Lecture 5-2023.pdfLecture 5-2023.pdf
Lecture 5-2023.pdfssuserff72e4
 
informationhiding-181103070958 (1).pdf
informationhiding-181103070958 (1).pdfinformationhiding-181103070958 (1).pdf
informationhiding-181103070958 (1).pdfssuserff72e4
 
chapter10-queue-161018120329.en.ar.pdf
chapter10-queue-161018120329.en.ar.pdfchapter10-queue-161018120329.en.ar.pdf
chapter10-queue-161018120329.en.ar.pdfssuserff72e4
 
cp264_lecture18_queue.ppt
cp264_lecture18_queue.pptcp264_lecture18_queue.ppt
cp264_lecture18_queue.pptssuserff72e4
 
chapter10-queue-161018120329.pdf
chapter10-queue-161018120329.pdfchapter10-queue-161018120329.pdf
chapter10-queue-161018120329.pdfssuserff72e4
 
Parts of speech in English.pptx
Parts of speech in English.pptxParts of speech in English.pptx
Parts of speech in English.pptxssuserff72e4
 
Lecture 2-2023.pdf
Lecture 2-2023.pdfLecture 2-2023.pdf
Lecture 2-2023.pdfssuserff72e4
 
Lecture1_computer vision-2023.pdf
Lecture1_computer vision-2023.pdfLecture1_computer vision-2023.pdf
Lecture1_computer vision-2023.pdfssuserff72e4
 

More from ssuserff72e4 (13)

Lecture 6-2023.pdf
Lecture 6-2023.pdfLecture 6-2023.pdf
Lecture 6-2023.pdf
 
Lecture 5-2023.pdf
Lecture 5-2023.pdfLecture 5-2023.pdf
Lecture 5-2023.pdf
 
informationhiding-181103070958 (1).pdf
informationhiding-181103070958 (1).pdfinformationhiding-181103070958 (1).pdf
informationhiding-181103070958 (1).pdf
 
chapter10-queue-161018120329.en.ar.pdf
chapter10-queue-161018120329.en.ar.pdfchapter10-queue-161018120329.en.ar.pdf
chapter10-queue-161018120329.en.ar.pdf
 
Queues.ppt
Queues.pptQueues.ppt
Queues.ppt
 
cp264_lecture18_queue.ppt
cp264_lecture18_queue.pptcp264_lecture18_queue.ppt
cp264_lecture18_queue.ppt
 
11.pptx
11.pptx11.pptx
11.pptx
 
Queues.ppt
Queues.pptQueues.ppt
Queues.ppt
 
chapter10-queue-161018120329.pdf
chapter10-queue-161018120329.pdfchapter10-queue-161018120329.pdf
chapter10-queue-161018120329.pdf
 
11.pdf
11.pdf11.pdf
11.pdf
 
Parts of speech in English.pptx
Parts of speech in English.pptxParts of speech in English.pptx
Parts of speech in English.pptx
 
Lecture 2-2023.pdf
Lecture 2-2023.pdfLecture 2-2023.pdf
Lecture 2-2023.pdf
 
Lecture1_computer vision-2023.pdf
Lecture1_computer vision-2023.pdfLecture1_computer vision-2023.pdf
Lecture1_computer vision-2023.pdf
 

Recently uploaded

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 

Recently uploaded (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 

Lecture 2-2023.pdf

  • 1. Lecture 2: Image types and formats Computer Vision In MATLAB By. Assist. Prof. Ielaf O.Abdul Majjed 2022-2023
  • 2. Concept of Bits Per Pixel bits per pixel (BPP) denotes the number of bits per pixel. The number of different colors in an image is depends on the depth of color or bits per pixel. f we devise a formula for the calculation of total number of combinations that can be made from bit, it would be like this. Put 1 in the formula you get 2, put 2 in the formula, you get 4. It grows exponentially. Bits per pixel Number of colors 1 bpp 2 colors 2 bpp 4 colors 3 bpp 8 colors 4 bpp 16 colors 5 bpp 32 colors 6 bpp 64 colors 7 bpp 128 colors 8 bpp 256 colors 10 bpp 1024 colors 16 bpp 65536 colors 24 bpp 16777216 colors (16.7 million colors) 32 bpp 4294967296 colors (4294 million colors) This table shows different BPP and the amount of color they contain. In case of 1 bpp, 0 denotes black, and 1 denotes white. In case 8 bpp, 0 denotes black, and 255 denotes white.
  • 3. The size of an image depends upon three things.  Number of rows  Number of columns  Number of bits per pixel The formula for calculating the size is Size of an image = rows * cols * bpp Image storage requirements Assuming it has 1024 rows and it has 1024 columns. And since it is a gray scale image, it has 256 different shades of gray or it has bits per pixel. Then putting these values in the formula, we get Size of an image = rows * cols * bpp = 1024 * 1024 * 8 = 8388608 bits. But since its not a standard answer that we recognize, so will convert it into our format. Converting it into bytes = 8388608 / 8 = 1048576 bytes. Converting into kilo bytes = 1048576 / 1024 = 1024kb. Converting into Mega bytes = 1024 / 1024 = 1 Mb. If you are given the size of the image and the bpp, you can also compute the rows and columns of a square image using the formula (same rows and same column).
  • 4. The distribution of colors within images may take numerous forms. Type of an Image 1.BINARY IMAGE: The binary image as its name suggests, contain only two pixel elements 0 & 1,where 0 refers to black and 1 refers to white. This image is also known as Monochrome or bi-level image. For converting an image into a binary image must choose a threshold value: If f(x,y) in Image is greater than or equal to the threshold, Then set f(x,y) = 255 If f(x,y) is less than to the threshold Then set f(x,y)=0. 2. GRAY LEVEL (SCALE) 8 BIT COLOR FORMAT 8 bit color format is one of the most famous image format Each pixel is represented by a single byte(8bit). It has 256 different shades of colors in it. It is commonly known as Grayscale image. The range of the colors in 8 bit vary from 0-255. Where 0 stands for black, and 255 stands for white, and 127 stands for gray color. Requires Color Look-Up Tables (LUTs) – Palette where the value of R & G & B in (LUTs) are equal.
  • 5. 3. COLOR IMAGES • 8 bit color image (index color). • 16 bit Hicolor. • 24 bit color image. • 23 bit color image. 8 bit color image (index color).  Each pixel used 8-bits to indicate the desired color. This number is then used as an index into a hardware table called the color palette that contains 256 entries, each holding a 24-bit RGB value. This is called indexed color.  This technique is also called pseudocolor.  Since humans are more sensitive to R and G than to B, we could use 3 bits for R and G,and 2 bits for B in index color.  Requires Color Look-Up Tables (LUTs) – Palette. 16-bit Hicolor images  The hicolor which uses 16 bits per pixel (5 R, 6 G, 5 B or 5 for each with 1 bit unused or 6R, 6G ,4B).  The maximum number of colors in 16 bit color image is 216 Color.  The palette does not affect the images.
  • 6. 24-bit color image  In a 24-bit color image, each pixel is represented by three bytes, usually representing RGB.  The maximum number of colors in 24bit color image is 224 or (16,777,216).  Such graphics are referred to as “True Color" images, or just as "24-bit"graphics.  If the browser is in 24-bit display, the palette does not affect the images. 32-bit color images  The 32-bit color images are actually stored as 32-bit (RGBA) images, with the extra byte of data for each pixel used to store an alpha value representing special effect information  If the browser is in 32-bit display, the palette does not affect the images.  Each pixel is represented by four byte(32bit).
  • 7. All the colors here are of the 24 bit format, that means each color has 8 bits of red, 8 bits of green, 8 bits of blue, in it. Or we can say each color has three different portions. You just have to change the quantity of these three portions to make any color. Binary color format Color: Black Decimal Code: (0,0,0) if we have to make a pure black color, we have to make all the three portion of R, G, B to 0. Color: White Decimal Code: (255,255,255) Color: Red Decimal Code: (255,0,0) Color: Green Decimal Code: (0,255,0) Color: Blue Decimal Code: (0,0,255) Color: Gray Decimal Code:(128,128,128) H.W. 1- Convert color images to gray using the equation and then using RGB2gray. 2- Zooming image. Different color codes
  • 8. Image Formats Image Format describes how data related to the image will be stored. Data can be stored in compressed, Uncompressed or vector format. Each format of the image have a different advantage and disadvantage. Image types such a TIFF are good for printing while JPG or PNG, are best for web. Many image formats adhere to the following simple model:  Header  Data (line by line, no breaks between lines). Header contains at least: A signature or “magic number” (i.e. a short sequence of bytes for identifying the file format) and the width and height of the image.
  • 9.  TIFF(.tif, .tiff) Tagged Image File Format this format store image data without losing any data. It do not perform any compression on images have a high-quality image is obtained but size of image is also large, which is good for printing, professional printing.  JPEG (.jpg, .jpeg) Joint Photographic Experts Group is a loss-prone (lossy) format in which data is lost to reduce size of image. Due to compression, some data is lost but that loss is very less. It is a very common format and are good for digital cameras, nonprofessional prints, E-Mail, Powerpoint etc., making it ideal for web use.  GIF (.gif) Graphics Interchange Format files are used for web graphics. They can be animated and are limited to only 256 colors, can allow for transparency. GIF files are typically small is size and are portable.  PNG (.png) Portable Network Graphics files are a lossless image format. It was designed to replace gif format as gif supported 256 colors unlike PNG which support 16 million colors.  Bitmap (.bmp) Bit Map Image file is developed by Microsoft for windows. It is same as TIFF due lossless, no compression property. Due to BMP being a proprietary format, it is generally recommended to use TIFF files.  EPS (.eps) Encapsulated PostScript file is a common vector file type. EPS files can be opened in applications such as Adobe Illustrator or CorelDRAW.  RAW Image Files (.raw, .cr2, .nef, .orf, .sr2) These Files are unprocessed created by a camera or scanner. Many digital SLR cameras can shoot in RAW, whether it be a .raw, .cr2, or .nef. These images are the equivalent of a digital negative, meaning that they hold a lot of image information. These images need to be processed in an editor such as Adobe Photoshop or Lightroom. It saves metadata and is used for photography.