Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Exporting 16bit BMP
#5
(04-16-2022, 09:31 AM)rich2005 Wrote: How can you tell if Gimp is exporting as a 565 bmp ? There is no real way...

You can inspect the byte at offset 0x1C using a hex editor. The specification says that this byte is set as follows:

1 = monochrome bitmap
4 = 16 colour bitmap
8 = 256 colour bitmap
16 (0x10) = 16-bit (high colour) bitmap
24 (0x18) = 24-bit (true colour) bitmap
32 (0x20) = 32-bit (true colour) bitmap


(so in each case this byte gives the number of bits required to hold the possible colours)

The byte at offset 0x1E should be set to 0x03 (BI_BITFIELDS)

The numbers of bits per colour are then given in the following bytes:

0x36..0x39 = 0x0000F800 (5 bits for red)
0x3A..0x3D = 0x0000007E (6 bits for green)
0x3E..0x41 = 0x0000001F (5 bits for blue)

These 3 double words hold the masks for the colour bits in each 16-bit value from the image data part of the file.

I have just check a normal 24-bit (8 bits each of R, G and B) and this byte is set to 0x18. I exported the file in the R5G6B5 format and the byte then holds 0x10. Apart from that the file is roughly 2/3 the size of the 24-bit one.

(Ghex works well on Linux Mint and I'm sure that there are Windows hex editors available - I have used them in the past but can't recall off-hand which ones I used)
Reply


Messages In This Thread
Exporting 16bit BMP - by bilbo - 04-15-2022, 09:15 PM
RE: Exporting 16bit BMP - by rich2005 - 04-16-2022, 09:31 AM
RE: Exporting 16bit BMP - by programmer_ceds - 04-16-2022, 04:05 PM
RE: Exporting 16bit BMP - by bilbo - 04-16-2022, 01:37 PM
RE: Exporting 16bit BMP - by rich2005 - 04-16-2022, 03:35 PM
RE: Exporting 16bit BMP - by bilbo - 04-16-2022, 06:44 PM
RE: Exporting 16bit BMP - by programmer_ceds - 04-16-2022, 07:28 PM

Forum Jump: