Given a truth table and two images, use the truth table as a bitwise operation to the two images.
For example with the truth table:
1 0 1 0 0 0 1 0
(Note that the top is the first image and the left is the second)
and the two images
(0, 2, 4) (a
1x1 image, with the numbers being RGB values) and
(30, 20, 10):
You would apply the above truth table to the numbers
30, of which's binary representations are
Using the truth table as a bitwise operation would get us
00000, or in decimal form
This means that the red value of the first pixel would be
Continuing this with the other RGB values would get us
4 for green and blue respectively.
So the output for this would be a
1x1 image with the only pixel having an RGB value of
0, 2, 4.
For images greater than
1x1, you apply the truth table for both corresponding pixels on both images and output it to the output image.
For example, if we had a pixel which is located at (x, y) in the image, you would apply the truth table to the R, G, and B values for the (x, y) position in the first image and the (x, y) position in the second. Once you have done this, the (x, y) position in the output image is the output of the truth table applied to the R, G, and B values.
You can use any default input or output method.
You can assume that the two input images are the same dimensions.
You can use any Standard Image I/O that supports RGB.
The truth table can be in any format you want.
As always, since this is code golf, lowest byte-count wins!