No announcement yet.

Bitmap and microvga color

  • Filter
  • Time
  • Show
Clear All
new posts

  • Bitmap and microvga color


    I'm trying to plot a bitmap graphic that I did in my computer. I did it in 256 colors bitmap, but the standart colors of bitmap are very diferent than the microvga colors.
    Does anybody kwond how to solve this problem?


  • #2

    I replied to your email, with the same query, on 4th of Aug. Do you need further assistance on that?



    • #3

      Yes, I saw the email and I started to implement the solution. I wanted to see if that woked before answers to you.

      The thing to move the bits from bitmap RGB to BGR of the microvga didn't work. I discoverd that when I convert the bitmap from 24-bit to 8-bit (the one that microvga uses), the conversion uses a table that is set in windows.

      For exemple, when I draw a circle in paint on my computer, it usually draw in 24-bit colormode. When I save in 8-bit the blue in teory is 0b00000011, or 0x03 but in fact is when I look to converted file I find that windows transforms to 0xFC (0b11111100)! It had to be yellow, but the yllow color is 0xFB or 0b11111011. It's because some colors (not all) are set by a conversion table.

      This table appears in the bitmap header. I have a pdf that explains all of this much better then this things I wrote, but it is in portuguese. But search on google or write me that I explain better.

      In the end, the solution for me was to make a table to. I put all the 256 color of the computer in sequence and ploted in microvga. Then I started to make a relation between them. It isn't perfect, but for me worked.



      • #4

        The proper way to do it is to go straight from the 24bit RGB to the 8 bit BGR and totally forget about the Windows BMP color table

        8bit Color = (blue & 0xc0) + ((green & 0xE0) >> 2) + ((red & 0xE0) >> 5)