Select-by-color range and .isSelected()

Boudewijn Rempt boud at
Fri Apr 1 14:45:31 CEST 2005

On Friday 01 April 2005 14:36, Casper Boemann wrote:
> On Friday 01 April 2005 13:55, Boudewijn Rempt wrote:
> > Selection is not an on/off binary value, but a range. The isSelected()
> > method returns a boolean to the filters, and that's the first place where
> > we go wrong.
> Yes. Perhaps we should change the method to selectedness().

Yes, I think that would be better.

> Also how about always assuming selection to be an 8 bit value. I think that
> should be enough even in the future. That would make it easier to work with
> so we don't have to go through a colorstrategy regarding selectedness
> (eventhough the selection paintdevice should have the mask strategy
> attached as now)

I already do that -- witness the comments in

// CBR this is wrong only first byte is inverted
// BSAR: But we have always only one byte in this color model :-).
*(it.rawData()) = QUANTUM_MAX - *(it.rawData());

> No, that is something I have puzzeled with too. For cutting I think we
> should manipulate the src and dst pixels according to selectedness.

The not completely selected pixels should have the selectedness subtracted 
from their opacity -- making them more transparent, or perhaps even 
completely transparent.

> > Desaturate is easy: just halve the saturation in the hsv representation
> > of a pixel. But oilpaint? Sharpen? What would be the meaning of 69%
> > selected there? Blit the sharpened pixel with 69% opacity over its
> > original?
> yes over 31% original

You mean modify the original to 31% of its original transparency and 
COMPOSITE_OVER the sharpened pixel at 69% of its transparency?

> In fact. for the moment I think we should just do what seems best in each
> case. Later on when we can always change to a more total solution if we
> need to.

Yes... In fact, I still haven't figured out a way to convert the closeness of 
a pixel to the prototype color in the colorrange dialog to a degree of 

Boudewijn Rempt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :

More information about the kimageshop mailing list