Page 1 of 1

24-bit to 12-bit color reduction

Posted: Fri Dec 20, 2002 4:26 pm
by 'dacker
I have an unusual application where I need to reduce 24-bit images to 12-bit images (4 bits per channel, 4096 total colors). On top of this, the RGB values MUST be EXACTLY certain values: 0,17,34,51,68,...255

I have been unable to find a way to do this and would appreciate any and all suggestions.

My searches on the net showed that 12-bit displays are being used on iPAQs and some color cell phones. This is not for any of these devices.

Posted: Mon Dec 23, 2002 6:12 pm
by HaraldHeim
Well that conversion is quite easy. Just divide each R, G and B value which ranges from 0 to 255 for 24bit images by 16. To get the 0,17,34,51,68,...255 values multiply the divided values with 17.