Color distance and the alpha channel

Bart Coppens kde at bartcoppens.be
Mon Jun 6 17:21:20 CEST 2005


You might have noticed that the fill painter does strange things when filling 
areas that contain transparant parts. This is because currently, the color 
difference is only calculated on the visible parts of the color. Thus, if I 
fill a black circle on a newly created transparent layer, the entire layer 
gets filled (because it thinks the entire layer has the same color: black).

Now I'm wondering what's the best sollution here. Create a seperate function 
like differenceWithAlpha(), or extend the current difference function to
difference(color1, color2, bool compareAlpha)?


More information about the kimageshop mailing list