So a coloured image can be converted to monochrome by taking the green data, byte by byte, doubling it, adding the red, doubling again and finally adding on the blue.
It is usual at this point to divide the result down until the gray image can be contained within bytes. This enables a small monochrome bitmap image having only a single layer of "colour" to be created.
Of course, one can leave the image as a RGB (red, green, blue) file. However, it takes up three times the space.
The author considered what might happen if the three images of the RGB bitmap were not all the same. What if one or other of the three colours differed only by one?
Black consisting of zero red and green, but having unit blue, is still black. It is defined as a "cold black". Similarly, black having unit red with zero green and blue is a "warm black". Black with zero red, unit green and zero blue is still not recognisable as other than black. The same applies throughout the brightness scale - 128 red, 128 green and 129 blue is simply a "cold gray".
After the number has been divided down to cover the range zero to 255, it is possible to look at the fractional part of that number. For example, if the number is 128.5, the top bit of the ".5" can be examined, and the green incremented if it is set, as it is in 128.5. The next bit, as in 128.25 or 128.75, advances the red by one. The final bit, as in 128.125, 128.375, 128.625 and 128.875, advances the blue.

You go to the DOS prompt, and type "g1785 lion", where "lion.bmp" is the name of your picture. Then you press "Enter".
A file called "G1785.BMP" is made:

1460 shades present
That's it.
It often happens that whilst working with graphics one finds that the 256 shades of a grayscale image are not adequate. Then "tone separation" occurs. On such occasions, the smoother flow of brightness in a 1785-shade image may be of help.
Do not save the image as a 256-shade file, or the added precision is lost.
| Home |
(C) 2010 Charles Douglas Wehner.
Use freely but do not plagiarise.