[MDA III, XDA III, PDA2k, 9090 Software Upgrading] Borg Number One:
Hi.

Theoretical stuff

Talking about this 15/16 bit fact:

Today in the early morning ( 01:00 ) :) I also figured out by my self,

how the R : G : B partition/apportionment/distribition in just 2 bytes works. :)

Many firms and developers, which / who build/t image and painting tools,

say that their products would support saving 16Bit bitmaps or 16bit TGA files,

but that is totally wrong!!!

Here is the reason:

[color values in 16bit bitmaps]

Meaning byte string => bit string

G B R G
Red pixel 007C => 00000000 01111100

Green pixel E003 => 11100000 00000011

Blue pixel 1F00 => 00011111 00000000

This is the way of storing pixel's color values in 16 bit bitmaps (.bmp).

For easier understanding, a byte-swapped view follows:

Meaning byte string => bit string

R G B
Red pixel 7C00 => 01111100 00000000

Green pixel 03E0 => 00000011 11100000

Blue pixel 001F => 00000000 00011111

You can see there is one bit not used - the most left one, before the red-value begins.

So, 16bit bitmaps are not really 16bit!!!

They are 15bit.

But, because it is impossible that 2Byte just consist of 15bit,

the name "16 bit bitmap" was used/taken/introduced and is still common.

The statement: "15bit = 2Byte" would break all rules.

The 16bit Targa format is able to take the previously "unused" bit for alpha values,

but not for R/G/B values.

Well, the 16bit splash logo format, which was/is used in PDAs, ..., etc.

is a totally new format.

All bits will be used for color values.

[color values in PDA splash logos]

Meaning byte string => bit string

G B R G
Red pixel 00F8 => 00000000 11111000

Green pixel E007 => 11100000 00000111

Blue pixel 1F00 => 00011111 00000000

For better understanding, a byte-swapped view follows:

Meaning byte string => bit string

R G B
Red pixel F800 => 11111000 00000000

Green pixel 700E => 00000111 11100000

Blue pixel 00F1 => 00000000 00011111

You can see, the green value uses 6 bits and the red and blue values uses 5 bits.

(5+6+5=16 ) ;).

So there are 2^5 * 2^6 * 2^5 ( = 65536 ) colors possible.

Exist commercial image formats, which also use this 5 : 6 : 5 - RGB system?

PS:

before you release a new version of your great .nb image tool,

please check if it converts 16bit splashlogos to 24bit bitmaps in a lossless way.

To do this "lossless converting check",

open a PDA splash logo file (e.g.: abc.nb) in your .nb image tool,

then use the "Save .bmp" button to convert the splash logo to a bitmap file (24bit),

finally convert the 24bit bitmap file

to another splash logo file (e.g.: xyz.nb).

Now, compare abc.nb and xyz.nb (with a hex editor).

If there are no differences, then your .nb image tool has the wonderfull abilities to convert 16bit to 24bit in a lossless way.

If there should be differences between abc.nb and xyz.nb,

then you should check your .nb image tool sources again.

16bit (5 : 6 : 5) can be lossless converted to 24bit!!!

Vice versa too, if the RGB values in the 24bit system suits to equivalent values in the 16bit system

For example:

a)

The value "6" (for color red in a 24bit system)

cannot be lossless converted to a value in a 16bit system.

b)

The value "7" (for color red in a 24bit system)

can be lossless converted to a value in a 16bit system.

=>it would be value "1" in the 16bit system.

c)

The value "254" (for color red in a 24bit system)

cannot be lossless converted to a value in a 16bit system.

d)

The value "255" (for color red in a 24bit system)

can be lossless converted to a value in a 16bit system.

=>it would be value "31" in the 16bit system.

Solution for mapping/image 16bit values in a 24bit system:

RED

2^8/2^5 = 2^3 = 8

=>256/8 = 32

=> 32 steps/nuances/shades for color RED in the 24bit (2^8 * 2^8 * 2^8)system:

=>5bit red (in the 16bit system): 0, 1, 2, 3, 4, 5, 6, 7,...31 (0,...,31 => 32 possible values :) )

is equivalent to:

=>8bit red (in the 24bit system): 0, 7, 14, 24, 31, 39, 47, 55,... 255

GREEN

2^8/2^6 = 2^2 = 4

=>256/4 = 64

=> 64 steps/nuances/shades for color GREEN in the 24bit system.

=> 0, 3, 7, 11, 15, 19, 23, 27,... 255

BLUE

2^8/2^5 = 2^3 = 8

=>256/8 = 32

=> 32 steps/nuances/shades for color BLUE in the 24bit system

=> 0, 7, 14, 24, 31, 39, 47, 55,... 255