|AWARE [SYSTEMS]||Imaging expertise for the Delphi developer|
|TIFF and LibTiff Mailing List Archive|
LibTiff Mailing List
2006.09.17 02:07 "Re: alpha in Grayscale or Palette", by Graeme Gill
Joris wrote: > > challenge here is to somehow involve alpha in that scheme. Is RGBA > (20,20,20,20) closest to RGBA (20,20,100,20), or is it closest to RGBA > (20,20,20,100)? Put more generally, you need to weigh color difference > against alpha difference, and it's not quite clear how to avoid making > rather arbitrary weight decisions. That doesn't seem that difficult. Assume the most sensitive situation (ie., against an opaque neutral background), and compute the RGB color that would result from that RGBA value. Convert color distance to a more visual metric if you like (L*a*b* maybe), and apply the usual color quantization algorithms in 4D, rather than 3D (I used to like the variance cut that I put in xli). The main limitation would be that your palette may be rather small when measured against the 4D space you're trying to quantize, and the result may not be that visually appealing. One trick that would help would be to scale the Alpha dimension so that it is quantized more coarsely, freeing up more palette entries for colors. (This seems all rather similar to the types of things I do in arriving at an "optimal" CMYK test point set used for color profiling, the Alpha being analogous to K ....) Graeme Gill.