[cairo] Mac Tiger Core Image

Nathan Hurst njh at hawthorn.csse.monash.edu.au
Thu Mar 10 21:36:04 PST 2005


On Thu, 10 Mar 2005, Bill Spitzak wrote:

> No, this is not a colorspace issue.
>
> Say the pixel is covered 50% by the first shape colored A, and 50% by the 
> second colored B, and the original color is C.
>
> The end result should be (A+B)/2.
>
> But after drawing the first shape it will be (A+C)/2. There is not enough 
> information to recover A so it is impossible to get a final result that has A 
> but not C.

Indeed, I was misinterpreting mental's original post as just the fact that 
(A+C)/2 doesn't look right, which it doesn't always in RGB space.

> In fact in Cairo and probably every other graphics program the end result is 
> going to be (A+B+2C)/4.

With the exception of the edge trees algorithm, yes.

> This does require turning off antialiasing of the edge pixels of the two 
> polygons. In that case the result of the first shape is either A or C. If it 
> is A then the second shape won't hit it and the result is still A, if it is C 
> the other shape will hit it and it is B. Thus the final result is then either 
> A or B. This is still not correct, but better than being able to see C 
> through a supposedly opaque surface.

As long as you don't have issues with edge pixels not being in either set, 
which is very hard /impossible to avoid?  I remember spending a lot of 
time trying to find a way around this some years ago, but there was no 
happy solution.

njh



More information about the cairo mailing list