Bitmap header format 
Author Message
 Bitmap header format

PLEASE can someone explain the bitmap header format to me?

I've asked at alt.lang.asm, looked on MSDN, tried to figure it out
myself...

I'm especially interested in 256-colour bitmaps.

Thanks a lot.

-ST



Thu, 01 Feb 2001 03:00:00 GMT  
 Bitmap header format

Quote:

>PLEASE can someone explain the bitmap header format to me?
>I've asked at alt.lang.asm, looked on MSDN, tried to figure it out
>myself...
>I'm especially interested in 256-colour bitmaps.

Depends on what type of bitmaps you want to look at, for example:
*.tga, *.bmp, *.pcx, ......
They all have their headers and pictures sorted out in different
manners, but to keep this message simple, a 256 colour picture
generally has this information...
1) Height of picture in pixels
2) Width of picture in pixels
3) The picture itself (which may or not be compressed) is limited to
only 256 colours which you choose and save in a table (4) below.
4) A 256x3 colour table (let's say R0,G0,B0,R1,G1,B1,R2,G2,B2,R3....)
5) Some more extra important stuff

So if your picture starts with say 1,0,2,7....    then:
the 1st pixel should be displayed using colours R1,G1,B1,
the 2nd pixel should be displayed using colours R0,G0,B0,
the 3rd pixel should be displayed using colours R2,G2,B2,
the 4th pixel should be displayed using colours R7,G7,B7.

If you use 256 colour VGA modes, the screen will display those
colours, if you use 16bit or 24bit graphics, you have to store the
actual R1,G1,B1,R0,G0,B0,R2,G2,B2,R7,G7,B7,..... on the screen at the
given locations.

I know there's a whole Bunch more to explain, but hope this helps you
get the idea.



Thu, 01 Feb 2001 03:00:00 GMT  
 Bitmap header format

Quote:

}PLEASE can someone explain the bitmap header format to me?

www.wotsit.org

Type BMP into the Search box. Or PCX or GIF or whatever. Wotsit has
info on a lot of different file formats.

I remember working with a program to process .BMP files a few years
ago and I had trouble with it. Kevin Quitt's addendum on the Wotsit
site might help.

--

netwurx.net | Engineering fears to tread.



Thu, 01 Feb 2001 03:00:00 GMT  
 Bitmap header format

Quote:

> PLEASE can someone explain the bitmap header format to me?

You mean the BMP-format?


Sun, 04 Feb 2001 03:00:00 GMT  
 Bitmap header format
Here is an extract of a very interesting file called "FileFMTS.LST"
by  Max Maischein I found on the net listing several file formats
including headers, structure, ... :

The BMP files are the way, Windows stores bit mapped images. The BMP
image

data is bit packed but every line must end on a dword boundary - if
thats not

the case, it must be padded with zeroes. BMP files are stored
bottom-up,

that means that the first scan line is the bottom line. The BMP format
has four

incarnations, two under Windows (new and old) and two under OS/2, all
are

described here.

OFFSET              Count TYPE   Description

0000h                   2 char   ID='BM' - BitMap

                                 OS/2 also supports the following IDs
:

                                 ID='BA' - Bitmap Array

                                 ID='CI' - Color Icon

                                 ID='CP' - Color Pointer (mouse
cursor)

                                 ID='IC' - Icon

                                 ID='PT' - Pointer (mouse cursor)

0002h                   1 dword  Filesize of whole file

0006h                   4 byte   reserved

000Ah                   1 dword  Offset of bitmap in file

                                 ="BOF"

000Eh                   1 dword  Length of BitMapInfoHeader

                                 The BitMapInfoHeader starts directly
after

                                 this header.

                                 12 - OS/2 1.x format

                                 40 - Windows 3.x format

                                 64 - OS/2 2.x format

0012h                   1 dword  Horizontal width of bitmap in pixels

0016h                   1 dword  Vertical width of bitmap in pixels

001Ah                   1 word   Number of planes

001Ch                   1 word   Bits per pixel ( thus the number of
colors )

                                 ="BPP"

001Eh                   1 dword  Compression type, see ALGRTHMS.txt
for descrip-

                                 tion of the different types

                                 0 - none

                                 1 - RLE 8-bit/Pixel

                                 2 - RLE 4-bit/Pixel

0022h                   1 dword  Size of picture in bytes

0026h                   1 dword  Horizontal resolution

002Ah                   1 dword  Vertical resolution

002Ah                   1 dword  Number of used colors

002Ah                   1 dword  Number of important colors

0036h                   ? rec    Definition of N colors

                                 N=1 shl "BPP"

                        1 byte   Blue component

                        1 byte   Green component

                        1 byte   Red component

                        1 byte   Filler

"BOF"                   ? byte   Image data

EXTENSION:BMP,RLE,LGO

OCCURENCES:PC

PROGRAMS:Windows,Paintbrush

REFERENCE:DDJ0994

VALIDATION
<snip>

Hope this helps...,
Dirky.



Thu, 08 Feb 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Bitmap header format + PTR operator

2. Converting Windows Bitmap to X bitmap format so that Tk can display it

3. How to Convert X Bitmap Format to Windows Bitmap Format?

4. Problem in Bitmap format

5. Problem in Bitmap format

6. The bitmap-format

7. Formatting Headers in a Browse Box

8. ANN: RFC 2047 decoding library (MIME format for non-ascii in mail headers)

9. Backup Exec tape header format

10. PE header format

11. Formatting Table Column Headers in VW2.0

 

 
Powered by phpBB® Forum Software