Re: [Algorithms] 256 colour palette
Brought to you by:
vexxed72
From: Gil G. <gg...@ma...> - 2000-08-30 20:55:42
|
This isn't right steve. RGB(8,16,8) = (8/31,16/63,8/31) in 565. Oddly, the divisor is not a power of two, because 31, not 32 is the maximum value that can be stored in 5 bits. -Gil > > True. But, as I stated earlier, this can be a bad thing (tm) as > > you don't get a pure grey ramp... just lots of icky slightly > > off greys in your palette, so its worth avoiding. > > Suppose you have one extra bit of Green - compared to > Red and Blue....you just have to set up the colour > lookup table such that even numbered green inputs > have the same output as the corresponding R and B > entries. > > Hence, R=8, G=16, B=8 would be an exact grey, but > R=8, G=15, B=8 would be a purplish grey and > R=8, G=17, B=8 would be a greenish grey. > > Then, so long as your greys have identical numbers for > Red and Blue and even numbered Greens, you'll get perfect > greys with the in between green values used for non-grey-scale > colours. > > The (slight) lossage here is that you can't quite get > maximum brightness Red or Blue entries. > > Steve Baker (817)619-2657 (Vox/Vox-Mail) > L3Com/Link Simulation & Training (817)619-2466 (Fax) > Work: sj...@li... http://www.link.com > Home: sjb...@ai... http://web2.airmail.net/sjbaker1 > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list |