Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

planes?

I found information on bitmap and pcx file formats. They each contain a number for storing the number of planes in the file.

What are they talking about? What are planes?
What are they used for?
Why is that information in a bitmap or pcx file?
«1

Comments

  • SephirothSephiroth Fayetteville, NC, USAMember Posts: 1,035
    : I found information on bitmap and pcx file formats. They each contain a number for storing the number of planes in the file.
    :
    : What are they talking about? What are planes?
    : What are they used for?
    : Why is that information in a bitmap or pcx file?
    :
    Not too sure about PCX format, but bitmaps with planes?! I never heard of such stuff. The bitmap data is in a simple array. The easiest way to read it in would be to read in the file header and the bitmap headers, then create an array the length and width of the image based on what the headers say. Here is an example.
    [code]
    //Read in the two headers
    unsigned char Array[Height][Width][3]; //You would change 3
    //to 4 if it was RGBA

    fread(&imagefile, sizeof(Array), 1, &Array);
    [/code]
    Now you have the bitmap in "Array", ready to go for anything!

    -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]

  • Josh CodeJosh Code Member Posts: 675
    : : I found information on bitmap and pcx file formats. They each contain a number for storing the number of planes in the file.
    : :
    : : What are they talking about? What are planes?
    : : What are they used for?
    : : Why is that information in a bitmap or pcx file?
    : :
    : Not too sure about PCX format, but bitmaps with planes?! I never heard of such stuff. The bitmap data is in a simple array. The easiest way to read it in would be to read in the file header and the bitmap headers, then create an array the length and width of the image based on what the headers say. Here is an example.
    : [code]
    : //Read in the two headers
    : unsigned char Array[Height][Width][3]; //You would change 3
    : //to 4 if it was RGBA
    :
    : fread(&imagefile, sizeof(Array), 1, &Array);
    : [/code]
    : Now you have the bitmap in "Array", ready to go for anything!
    :
    : -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]
    :
    :

    Thanks but I'm more curious about what the planes are for. I am not depending on it to load files. I am just curious about it.

    The number of planes is in the header section of the file. I am using Delphi and found it as a property in windows.tagbitmap. It is also, probably an attribute of a struct in windows.h.

    I'm just curious about what planes are. I have been able to load files without using the number of planes. I understand what the other information is for. I want to know more about it.


  • pcwlaipcwlai Member Posts: 4
    In the old days, EGA and VGA display card standards uses a concept called planes. The frame buffer of them is seperated into planes. Each plane may be a part of the frame buffer which is to hold a particular color component. Sure, there's no true color in that time. The color component values are not as the same as in today's hardware.

    BMP and PCX are very old graphics file formats. So, they cope with the concept and for the ease of loading images, they have planes built into the file format.

    Now, as true color becomes the standard, not much people still uses the old formats. Even in Windows, most BMP files do not use planes.
  • Josh CodeJosh Code Member Posts: 675
    : In the old days, EGA and VGA display card standards uses a concept called planes. The frame buffer of them is seperated into planes. Each plane may be a part of the frame buffer which is to hold a particular color component. Sure, there's no true color in that time. The color component values are not as the same as in today's hardware.
    :
    : BMP and PCX are very old graphics file formats. So, they cope with the concept and for the ease of loading images, they have planes built into the file format.
    :
    : Now, as true color becomes the standard, not much people still uses the old formats. Even in Windows, most BMP files do not use planes.
    :

    Thanks for the info
  • WudanWudan Member Posts: 66
    : I found information on bitmap and pcx file formats. They each contain a number for storing the number of planes in the file.
    :
    : What are they talking about? What are planes?
    : What are they used for?
    : Why is that information in a bitmap or pcx file?
    :

    Hi Josh.
    Planes are a blast from the past realy. Although a similar format is used in games today, especialy ps2. Paletted formats are small and give good image quality and are easy for grahics hardware to use. So this is why they are still popular. Anything with a palette (spell ? ) is sort of the same as planed image formats.
    The concept is quite simple. With an image that uses a palette, you get image data and a palette. The palette contains the colours themselves, usualy in rgb format. The image data contains an index into the palette. So as you read the image data accross the screen, you would read a value of say 5, then get the 5th colour out of the palette. The bigger the palette the better, as you can get more colours. Commone sizes are 16 colour ( 4 bit ) and 256 colour ( 8 bit ). they are described as 4 bit, & 8 bit because if you have 4 bits, that can only be on or off, then you can get 16 combinations, and so 16 colours.
    The plane format you speak of is one of these bits. So if your pcx file contains 4 bit planes, then its a 16 colour paletted image. If it has 8 bit planes, then its a 256 colour image :)

    hope this helps


  • Josh CodeJosh Code Member Posts: 675
    : : I found information on bitmap and pcx file formats. They each contain a number for storing the number of planes in the file.
    : :
    : : What are they talking about? What are planes?
    : : What are they used for?
    : : Why is that information in a bitmap or pcx file?
    : :
    :
    : Hi Josh.
    : Planes are a blast from the past realy. Although a similar format is used in games today, especialy ps2. Paletted formats are small and give good image quality and are easy for grahics hardware to use. So this is why they are still popular. Anything with a palette (spell ? ) is sort of the same as planed image formats.
    : The concept is quite simple. With an image that uses a palette, you get image data and a palette. The palette contains the colours themselves, usualy in rgb format. The image data contains an index into the palette. So as you read the image data accross the screen, you would read a value of say 5, then get the 5th colour out of the palette. The bigger the palette the better, as you can get more colours. Commone sizes are 16 colour ( 4 bit ) and 256 colour ( 8 bit ). they are described as 4 bit, & 8 bit because if you have 4 bits, that can only be on or off, then you can get 16 combinations, and so 16 colours.
    : The plane format you speak of is one of these bits. So if your pcx file contains 4 bit planes, then its a 16 colour paletted image. If it has 8 bit planes, then its a 256 colour image :)
    :
    : hope this helps
    :
    :
    :

    Each plane is just a posible colour for a pixel?

    a 4-bit bitmap would have 16 planes?

    an x-bit bitmap would have 2^x planes?

    Is there any difference between the number of planes and the colour depth?

    is it used at all for graphics that don't use palettes?


  • WudanWudan Member Posts: 66
    : Each plane is just a posible colour for a pixel?
    :
    Each plane contains a bit which is used to create an index into a colour palette.

    : a 4-bit bitmap would have 16 planes?
    :
    a 4-bit bitmap would have 4 planes

    Each bitplane is a plane of bits.. I'll explain with a small example. Say we have a 5X5 screen, with 2 bit planes. 2 bit planes means 2 bits per pixel, so thats 4 colours. Here's how the two 5X5 planes may look...

    1st bitplane...
    10110
    00000
    00000
    00000

    2nd bitplane
    00110
    00000
    00000
    00000

    and our palette. In RGB format
    0,0,0
    255,0,0
    0,255,0
    0,0,255

    So the first value from the 1st bitplane contains 1
    first value from the 2nd bitplane contains 0
    this gives you a hex value of 01.
    use this as an index into the palette.
    so 1st colour is red ( 255,0,0 )

    2nd value from the 1st bitplane contains 0
    2nd value from the 2nd bitplane contains 0
    this gives you a hex value of 00.
    use this as an index into the palette.
    so 2nd colour is black ( 0,0,0 )

    3rd value from the 1st bitplane contains 1
    3rd value from the 2nd bitplane contains 1
    this gives you a hex value of 11.( or 3 in decimal )
    use this as an index into the palette.
    so 3rd colour is blue ( 0,0,255 )

    Back in the old days, the amiga hardware had a memory layout like this. You would have the colour bitplanes planes layed out one after the other. The common art program ( called Dpaint at the time ) used a format called ILBM ( intereaved BitMap) which is exactly this bitplane format. Then along came pcx which used the same method for some backward compatibilty issues I suspect.
  • Josh CodeJosh Code Member Posts: 675
    : : Each plane is just a posible colour for a pixel?
    : :
    : Each plane contains a bit which is used to create an index into a colour palette.
    :
    : : a 4-bit bitmap would have 16 planes?
    : :
    : a 4-bit bitmap would have 4 planes
    :
    : Each bitplane is a plane of bits.. I'll explain with a small example. Say we have a 5X5 screen, with 2 bit planes. 2 bit planes means 2 bits per pixel, so thats 4 colours. Here's how the two 5X5 planes may look...
    :
    : 1st bitplane...
    : 10110
    : 00000
    : 00000
    : 00000
    :
    : 2nd bitplane
    : 00110
    : 00000
    : 00000
    : 00000
    :
    : and our palette. In RGB format
    : 0,0,0
    : 255,0,0
    : 0,255,0
    : 0,0,255
    :
    : So the first value from the 1st bitplane contains 1
    : first value from the 2nd bitplane contains 0
    : this gives you a binary value of 01.
    : use this as an index into the palette.
    : so 1st colour is red ( 255,0,0 )
    :
    : 2nd value from the 1st bitplane contains 0
    : 2nd value from the 2nd bitplane contains 0
    : this gives you a binary value of 00.
    : use this as an index into the palette.
    : so 2nd colour is black ( 0,0,0 )
    :
    : 3rd value from the 1st bitplane contains 1
    : 3rd value from the 2nd bitplane contains 1
    : this gives you a [red]binary[/red] value of 11.( or 3 in decimal )
    : use this as an index into the palette.
    : so 3rd colour is blue ( 0,0,255 )

    I think you mean binary. 11 in binary is 3 in decimal. 11 in hex is 17 in decimal.

    :
    : Back in the old days, the amiga hardware had a memory layout like this. You would have the colour bitplanes planes layed out one after the other. The common art program ( called Dpaint at the time ) used a format called ILBM ( intereaved BitMap) which is exactly this bitplane format. Then along came pcx which used the same method for some backward compatibilty issues I suspect.
    :

    For a 4-bit bitmap, each pixel would be stored in 4 bits.
    If they used several 4 planes, there would be 4 bits in different parts of the file. Usually, they are together, though.

    Usually bitmaps use 1 plane, right?
    I tried loading some bitmap files and found that each pixel had all of its bits together. I mean that for a 4-bit bitmap, 2 pixels would be stored in one byte. I didn't find that each bit was separated into a different plane in a different part of the file.




  • WudanWudan Member Posts: 66
    : I think you mean binary. 11 in binary is 3 in decimal. 11 in hex is 17 in decimal.

    correct.

    : For a 4-bit bitmap, each pixel would be stored in 4 bits.
    : If they used several 4 planes, there would be 4 bits in different parts of the file. Usually, they are together, though.
    :
    : Usually bitmaps use 1 plane, right?

    Well, they usualy have all the image data in one place if thats what you mean. This is how the old bitplane format worked though, If you had a 320X200 4 bit screen, you'd get 320X200 bits, 4 times. I think maybe the terminology has got lost over the years. Bit planes are exactly what it says on the tin. A plane of bits ( a plane being a flat square ). The image format at the time was basicaly the same as the graphics memory layout. This is different nowadays so formats tend to change like this.

    : I tried loading some bitmap files and found that each pixel had all of its bits together. I mean that for a 4-bit bitmap, 2 pixels would be stored in one byte. I didn't find that each bit was separated into a different plane in a different part of the file.
    :

    Bitmap is different to bitplanes. Like I say, the terminology may still be used even though the format itself is old school. The method I explained earlier was bitplanes, which whas your initial question :)

  • Karl007Karl007 Member Posts: 27
    As far as I remember the mem layout was even more complex on a ST. I have forgotten about Amiga because there were many layouts. But I think there was the same layout also available in 16 and 32 color modes.

    The 1st bit of the 16 first pixels (0-15).
    Then the 2nd bit of the 16 first pixels.
    Then the 3rd bit of the 16 first pixels.
    Then the 4th bit of the 16 first pixels.

    Then the 1st bit of the 16 next pixels (16-31).
    ...


    This means the planes were interleaved on word (16 bit) granularity. I don't know if this expression is perfect. What a dreadful time for computer graphics. But it was also funny because this allowed so many weird demo tricks !

«1
Sign In or Register to comment.