Download presentation
Presentation is loading. Please wait.
1
Getting Image Data Image Data Files 11/15/2018
Copyright Gene A Tagliarini, PhD
2
Copyright Gene A Tagliarini, PhD
Common Issues Identifying the image file type File organization Data compression Structural information How many sub-images How are they to be rendered Notations 11/15/2018 Copyright Gene A Tagliarini, PhD
3
Typical File Organization
Header File identifier Image parameters (height, width, layers, compression scheme, etc.) Data Color table Explicit sample data 11/15/2018 Copyright Gene A Tagliarini, PhD
4
Copyright Gene A Tagliarini, PhD
Example 1: ARF Files 11/15/2018 Copyright Gene A Tagliarini, PhD
5
Example 1: ARF Files (cont’d)
Header Contains 32 bytes (here indexed 0-31) Bytes 8-11 represent the image height Bytes represent the image width Data A single linear list of (height * width) pixel intensities 11/15/2018 Copyright Gene A Tagliarini, PhD
6
Example 1: ARF Files (cont’d)
How large would a file be? Assume Width = 640 Height = 480 Pixel intensities from (fit in an unsigned byte) Header = 32 bytes File size = 307,232 bytes = 640* 11/15/2018 Copyright Gene A Tagliarini, PhD
7
Example 1: ARF Files (cont’d)
11/15/2018 Copyright Gene A Tagliarini, PhD
8
What about color image files?
11/15/2018 Copyright Gene A Tagliarini, PhD
9
Copyright Gene A Tagliarini, PhD
A Color Vision Model 11/15/2018 Copyright Gene A Tagliarini, PhD
10
Copyright Gene A Tagliarini, PhD
Example 2: BMP Files 11/15/2018 Copyright Gene A Tagliarini, PhD
11
Example 2: BMP Files (cont’d)
Common but not parsimonious Permits Color tables Various numbers bits per pixel Explicit color specification for each pixel Compression (rarely encountered) 11/15/2018 Copyright Gene A Tagliarini, PhD
12
Example 2: BMP Files (cont’d)
Header Information Offset Field Size Content 0x0 Identifier 2 Type of BMP (ASCII “BM” i.e., 66,77 = bitmap) 0x2 File size 4 Total number of bytes in the file 0x6 Reserved For future use 0xA Data offset Offset from beginning of file to start of data (in bytes) 0xE Header size Total number of bytes in the information header 0x12 Width Bitmap width in pixels 0x16 Height Bitmap height in pixels 0x1A Planes Number of planes 11/15/2018 Copyright Gene A Tagliarini, PhD
13
Example 2: BMP Files (cont’d)
Header Information Offset Field Size Content 0x1C Bits per pixel 2 Possible values: 1 – Monochrome image 4 – 16 color bitmap 8 – 256 color bitmap 16 – 16-bit (high color) bitmap 24 – 24-bit (true color) bitmap 32 – 32-bit (true color) bitmap 0x1E Compression 4 Compression specification (0 means no compression) 0x22 Bitmap data size Size of data in bytes (rounded up to the nearest even multiple of four bytes) 0x26 HResolution Horizontal resolution in pixels/meter 0x2A VResolution Vertical resolution in pixels/meter 11/15/2018 Copyright Gene A Tagliarini, PhD
14
Example 2: BMP Files (cont’d)
Header Information Offset Field Size Content 0x2E Colors 4 Number of colors used; for 8-bits/pixel this value will be 256 (0x100) 0x32 Important Colors Value = Colors when all are important 0x36 Palette N*4 bytes Palette specification. Four bytes for each color in the palette 1 byte for the blue component 1 byte for the green component 1 byte for the red component 1 byte for fill to double word boundary (= 0x00) 0x436 Bitmap data X bytes Depends upon compression scheme; points to values in the palette or gives explicit values for the blue, green, and red components 11/15/2018 Copyright Gene A Tagliarini, PhD
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.