
An AND gate can be replaced by an OR gate with both inverted inputs and outputs. Correspondingly, the OR gate can be replaced with an AND gate with both inverted inputs and outputs.
To test De Morgan's transformation, and check out this nice Boolean logic gate applet.
In Photoshop, a MULTIPLY blend mode is equivalent to an AND logic gate. When two images are multiplied, both have to be bright to produce a bright result. If either one is dark, the result will be dark.
A SCREEN blend mode can be replicated exactly by inverting two layers, multiplying them, and inverting the result. De Morgan's rules. This means that if a MULTIPLY blend mode is analogous to an AND Boolean logic gate then a SCREEN blend mode must be an OR gate. And sure enough, it is analagous to one. In a SCREEN blend, if either layer is bright (or if both are bright) then the result will be bright. Since SCREEN mode is derived from MULTIPLY mode using essentially De Morgan's rule, it would seem that SCREEN is a 'better' description of an OR gate than Linear Dodge (Add) is.
It also turns out that the transformation between MULTIPLY and SCREEN works the other way, as well. A MULTIPLY blend mode can be created by SCREENING two negatives and inverting the reult, also as predicted by De Morgan.
DIFFERENCE blend mode acts like an EXCLUSIVE OR (XOR) gate. If either layer is bright the results will be bright. If both layers are bright the results will be dark.
UPDATE 5/4/2009
Josh Tynjala has a really great Flash-based logic gate circuit simulator.

Leave a comment