Labels: Java image and image synthesis transparency
Blog purpose: Use graphs to speak
Auxiliary text description:
Purpose: display an image in a specified area. The other part is transparent.
Preparation: Prepare two images A and B. The display part of A is black and the transparent part is white. The display part of B remains unchanged, and the transparent part is filled with black.
Process: Perform the and operation on the image and the background. The displayed area is black. Then, perform the XOR operation on the Image B and the black area. In this way, you can get a transparent background image.
Principle: All data in the computer is 0 and 1. If we use RGB to represent the color, each of which is 8-bit binary, then the white color is 24-bit 1, and the black color is 24-Bit 0. when white and other colors X are used as the and operation, the color x is obtained. In the XOR operation, 0 and any color x are calculated as color x.
Zookeeper
Image synthesis principle