The Color Bit Depth Reducer is a simple and convenient utility that down converts 24 bit RGB color values to their closest equivalent in a variety of lower bit depths.
24 bit RGB is so called because it consists of 8 bits in each of the red (R), green (G) and blue (B) color components. As 8 bits represent up to 256 different values, 24 bit RGB allows for 256 x 256 x 256 or 16,777,216 unique colors.
Web Hex is a common way of representing 24 bit RGB by representing the color components as hexadecimal values. This utility will allow you to enter RGB values either as individual decimal bytes for each of the individual color components, or as a single string of Web Hex such as #E4A392.
After entering the color that you would like to convert to a lower bit depth, select the particular bit depth you require from the drop down list. You will notice there are two convert buttons. Simply click on the one next to the Web Hex entry if you entered a value there, or the other button if you entered decimal bytes for the RGB components.
The result of the conversion will be presented in the gray box below the Color Bit Depth Reducer. The RGB value returned is the 24 bit RGB equivalent of the lower bit depth version of the converted color. A Web Hex value is also returned for convenience. Finally a Native version of the color is presented. This is simply the color as it would be defined (in decimal) using the bit depth you down converted to. The number range in parentheses indicates the range of decimal values that particular bit depth supports for the color components. For example (0-7) simply means that each of the red, green and blue components support values from zero to seven.
Below is a pair of colors that begin in 24 bit RGB which are then down-converted (from left to right) to 18 bit, 12 bit, 9 bit and 6 bit color. As you can see, by reducing the color component bit depth it can become increasingly difficult to match the original color. This does not hold true for all colors however. In particular there will be no issues with down-converting colors which the lower bit depths are already able to display within their existing color gamuts.
As an example of use, let’s convert a nice orange color into the closest match that an Atari ST can display with it’s palette of 512 colors. The Web Hex of this color is #f57900 and so we enter this value into the corresponding Web Hex field below. From the drop down list we select 3|3|3 – 512 colors. This specifies that we want 3 bits in each of the red, green and blue color components which provides us with 512 unique colors. This is what the original specification Atari ST is capable of, though later models of Atari computers (STE/TT/Falcon) do support more colors.
After clicking the convert button we get the resulting Web Hex conversion value of #da6d00. In order to reproduce this on an Atari ST we would specify an RGB value of 3, 7, 4 while working on the ST.
Supported Color Component Bit Depths
|Bit Depth||Red||Green||Blue||Colors||Sample Use|
|21 bit||0-127||0-127||0-127||2,097,152||Nintendo 64|
|16 bit||0-31||0-63||0-31||65,536||RGB 565|
|15 bit||0-31||0-31||0-31||32,768||High Color|
|9 bit||0-7||0-7||0-7||512||Atari ST
How it works
As previously noted, 24 bit RGB color components have values that range from 0 – 255. In order to reduce values in this range to lower bit depth ranges, we need to know the maximum color component values supported by the various bit depths. Please refer to the table above for an overview of bit depths supported by this utility and their individual color component ranges. As an example, 12 bit color has red, green and blue color component values in the range of 0 – 15.
To begin we need to select a 24 bit RGB color to convert : RGB = 200, 143, 96. We can now calculate the equivalent in 12 bit color one component at a time. The Amiga uses 12 bit color and so we will be creating an Amiga compatible color. Let’s begin with the red value of 200. We will convert this into a 0-15 range value and just keep the integer part (discarding digits past the decimal point).
col = 200
amigaCol = col * 15 / 255
amigaCol = 11
By doing this again for the green and blue components we arrive at the equivalent Amiga RGB (12 bit) color : Amiga RGB = 11, 8, 5. The 15 in the formula above is the maximum value (0-15) that 12 bit color can support for each color component. The 255 is the maximum that 24 bit RGB color components can support. Simply change the 15 to match the maximum value of the color component bit depth you wish to convert to.
Finally, if we want to convert this back into 24 bit RGB in order to display it on modern hardware we simply flip things around (and again just keep the integer portion) :
col = 255 / 15 * amigaCol
Doing this for each of the color components results in our end result which is a 24 bit RGB equivalent of a 12 bit RGB Amiga color : 187, 136, 85.
Hopefully this utility will come in handy for those who want to get the correct color equivalents for classic computers such as the ST or Amiga, or for those who are still producing art directly on these platforms.