How to achive colorspace independence

Casper Boemann cbr at boemann.dk
Wed Nov 2 14:32:26 CET 2005


On Saturday 22 October 2005 21:52, Michael Thaler wrote:
> On Friday 21 October 2005 21:58, Casper Boemann wrote:
> > 2) Scaling and other things where each resulting pixel is the weigthed
> > mixture of a number of pixels. The mixColors function in the cs does this
> > rather well.
>
> Out of curiosity I tried for what colorspaces the current scaling algorithm
> does work and I was very surprised that it actually worked for all
> colorspaces except the 32 bit floating one (I forgot the name and I just
> uninstalled krita). And even for this colorspace it kind of works. It only
> gets some pixels wrong (I think that is because the scaling algorithm
> actually checks some border cases and treats them in a special way and this
> fails for the 32 bit colorspace).
>
> Or maybe Layer->Convert layer just doesn't work and they are all RGB8. But
> I don't think so because the filter needs twice as long if you convert to
> RGB16.
>
> Maybe somebody has an idea why scaling works even for 16 bit floating point
> RGB color channels with the current algorithm?
not really, but something has to do with luck.

a 16bit int is easily explained as even in the worst of circumstances it's 
only off by 1/256 which is hardly noticable. Remember that you actually do a 
correct averaging for the high 8 bits.

a 16bit float could for the mantisse part be explained the same way, and if 
the image is first converted from 8 bit then the 9-12 bit are 0 and with 
exponent roughly the same for nearby pixels that might explain it.

why that wouldn't hold for 32 bit float too I don't know, but exposure might 
explain that the bit are not filled the same way. don't know. Adrian?

-- 
best regards / venlig hilsen
Casper Boemann


More information about the kimageshop mailing list