View Single Post
Old 28th April 2003, 10:38   #73
AVS Axer
AVS Axer's Avatar
Join Date: Feb 2003
Location: Ozshtrayleeuh
Posts: 98
XOR blending mode was also asked about somewhere..

Sadly itsnot as simple as you would hope.

Xor is computed at the binary level.
So, each pixel has the compondents r,g,b (depending on how old your comp is ho ho.)
And each r,g, or b, can be described as a binary digit. (or bit)

ok.. lets lets just look at one channel, say r. and just one pixel.
we have A=0010,1010, B=0101,0111

dont wory about what those colours are, or even what those numbers are, i dont know either.

For this demo, A is the old image, B is the blending image.

A XOR B means the same as (A OR B)NOT(A AND B)
in binary logic, 0 is false, 1 is true.

so it will return "TRUE"(1) if a OR b are 1, but "FALSE"(0) if a AND b are both 1, and 0 if neither a OR b are 1.


you see now?

This is applied to all colour chanels and the same to every pixel.

Notice some things..

*if image A and B are the same, the whole screen would be black,

*two completely different solid colours (different in all r,g and b), the whole screen would be white.

*any identicle pixels would be shaded black

Last edited by AVS Axer; 28th April 2003 at 11:00.
AVS Axer is offline   Reply With Quote