Sei sulla pagina 1di 26

Image Data Types

Types of Images

1 bit image
8 bit grey scale images
24 bit colour images
8 bit colour images
Images are made up of pixels
1- Bit Images
Use a single bit to represent each pixel (dot on
the screen)
00101
1-bit Images
Each pixel is stored as a single bit (0 or 1), so also referred
to as a binary image.
Such an image is also called a 1-bit monochrome image
since it contains no color.
How can you calculate image
memory size or file size
File size calculation:

EX: Resolution: 640 x 480


File size = width*height*no
. of bytes per pixel
1-bit Images
File size = 640 x 480 x 1/8 = 38400 bytes
(38.4 kB)

1 byte=8bits
1/8byte=1bit

School of Science \ Computer Science


16/06/17 9
Dept.
Image resolution refers to the number of pixels in a digital image (higher resolution
always yields better quality).
8-Bit Gray-Level Images
8 Bit Grey Scale Images
Representing shades of grey

Now 1 pixel = 8 bits


8-bit Gray-level Images
Each pixel has a gray-value between 0 and 255.
Each pixel is represented by a single byte; e.g., a
dark pixel might have a value of 10, and a bright
one might be 230.
A bit id turned on if the image pixel has non zero
value(from 1 TO 252)

School of Science \ Computer Science


16/06/17 13
Dept.
256 Shades of Grey
Bitmap

The two-dimensional array of pixel values that


represents the graphics/image data.
8-bit image can be thought of as a set of 1-bit bit-
planes, where each plane consists of a 1-bit
representation of the image
nth bit plane on an m-bit dataset is set to 1, it contributes a value of 2(m-n)

For example, in the 8-bit value 10110101 (181 in decimal) the bit planes work as
follows:

Bit Plane Value Contribution Running Total


2(8-1)
1st 1 1 * 2^7 = 128 128

2nd 0 0 * 2^6 =0 128


3rd 1 1 * 2^5 = 32 160

4th 1 1 * 2^4 = 16 176

5th 0 0 * 2^3 = 0 176


6th 1 1 * 2^2 = 4 180
7th 0 0 * 2^1 = 0 180
File Size Calculations
File size = 640 x 480 x 1 = 307200bytes
(300 kB)

1 pixel=8bits=1 byte
Monochrome 1-bit and Grayscale 8-bit image

38 400 Bytes 307 200 Bytes


School of Science \ Computer Science
16/06/17 19
Dept.
Dithering
Dithering is often used for displaying monochrome images
Creating the illusion of new colors and shades by varying the pattern of dots.
Newspaper photographs, for example, are dithered. If you look closely, you
can see that different shades of gray are produced by varying the patterns
of black and white dots. There are no gray dots at all. The more dither
patterns that a device or program supports, the more shades of gray it can
represent.
In printing, dithering is usually called halftoning, and shades of gray are
called halftones. Note that dithering differs from gray scaling. In gray scaling,
each individual dot can have a different shade of gray.

20
1.Half-tone printing is an analog process that uses smaller or
larger filled circles of black ink to represent shading, for
newspaper printing.
2.For example, if we use a 2 2 dither matrix
Dithering
Dithering
A clever trick can get around this problem.
Suppose we wish to use a larger, 44 dither
matrix, such as
Today: Pixel encodings

RGB Color
Bitmap Grayscale 3 colors: red, green, blue
1 bit 8 bits 8 bits/color
24 bits

CSC 1040 - Computing with Images 24


Comparing file sizes for
300 x 200 image:

RGB Color
Bitmap Grayscale 3 colors: red, green, blue
1 bit 8 bits (1 byte) 24 bits (3 bytes)

7.3 KB 58.6 KB
175.8 KB
CSC 1040 - Computing with Images 25
24-bit color
(60KB jpeg)

8-bit color
(30KB gif)

26

Potrebbero piacerti anche