Blockchain-based image processing method and apparatus
Methods, systems, and apparatus, including computer programs encoded on computer storage media, for blockchain-based image processing are provided. One of the methods comprises: obtaining, by a computing device, copyright-related information corresponding to an original image; sending, by the computing device, the copyright-related information to one or more blockchain nodes configured to obtain ciphertext information by encrypting the copyright-related information and to store the ciphertext information in the blockchain; obtaining, by the computing device, the ciphertext information from the blockchain; and performing, by the computing device, obfuscation on a pixel matrix of the original image based on the ciphertext information to generate a target image carrying the copyright-related information.
1. A blockchain-based image processing method, comprising:
obtaining, by a computing device, copyright-related information corresponding to an original image;
sending, by the computing device, the copyright-related information to one or more blockchain nodes configured to obtain ciphertext information by encrypting the copyright-related information and to store the ciphertext information in the blockchain;
obtaining, by the computing device, the ciphertext information from the blockchain; and
performing, by the computing device, obfuscation on a pixel matrix of the original image based on the ciphertext information to generate a target image carrying the copyright-related information, by:
encoding the ciphertext information to obtain a binary string corresponding to the ciphertext information;
inserting at least one character of the binary string into the pixel matrix according to a set character spacing; and
dividing the pixel matrix into a plurality of pixel regions according to a set dividing rule, and inserting the binary string into at least one of the pixel regions; or
dividing the pixel matrix into a plurality of pixel regions according to a set dividing rule, and inserting a portion of the binary string into each of the pixel regions.
2. The method of claim 1 , wherein the performing obfuscation on a pixel matrix of the original image based on the ciphertext information further comprises:
using the binary string to replace redundant pixels in the pixel matrix according to a set replacing rule.
3. The method of claim 1 , further comprising:
recording process information of performing obfuscation on the pixel matrix; and
sending the process information to the one or more blockchain nodes for storing in the blockchain.
4. The method of claim 1 , wherein the copyright-related information further comprises:
current time information;
current geographic location information; or
identification information of the computing device.
5. The method of claim 1 , wherein the copyright-related information further comprises copyright owner information of a copyright owner corresponding to the original image, wherein the copyright owner information comprises:
a name of the copyright owner; or
an ID number of the copyright owner.
6. A blockchain-based image processing system, comprising a processor and a non-transitory computer-readable storage medium storing instructions executable by the processor to cause the system to perform operations comprising:
obtaining copyright-related information corresponding to an original image;
sending the copyright-related information to one or more blockchain nodes configured to obtain ciphertext information by encrypting the copyright-related information and to store the ciphertext information in the blockchain;
obtaining the ciphertext information from the blockchain; and
performing obfuscation on a pixel matrix of the original image based on the ciphertext information to generate a target image carrying the copyright-related information, by:
encoding the ciphertext information to obtain a binary string corresponding to the ciphertext information;
inserting at least one character of the binary string into the pixel matrix according to a set character spacing; and
dividing the pixel matrix into a plurality of pixel regions according to a set dividing rule, and inserting the binary string into at least one of the pixel regions; or
dividing the pixel matrix into a plurality of pixel regions according to a set dividing rule, and inserting a portion of the binary string into each of the pixel regions.
7. The system of claim 6 , wherein the performing obfuscation on a pixel matrix of the original image based on the ciphertext information further comprises:
using the binary string to replace redundant pixels in the pixel matrix according to a set replacing rule.
8. The system of claim 6 , wherein the operations further comprise:
recording process information of performing obfuscation on the pixel matrix; and
sending the process information to the one or more blockchain nodes for storing in the blockchain.
9. The system of claim 6 , wherein the copyright-related information further comprises:
current time information;
current geographic location information; or
identification information of the computing device.
10. The system of claim 6 , wherein the copyright-related information further comprises copyright owner information of a copyright owner corresponding to the original image, wherein the copyright owner information comprises:
a name of the copyright owner; or
an ID number of the copyright owner.
11. A non-transitory computer-readable storage medium for blockchain-based image processing, configured with instructions executable by one or more processors to cause the one or more processors to perform operations comprising:
obtaining copyright-related information corresponding to an original image;
sending the copyright-related information to one or more blockchain nodes configured to obtain ciphertext information by encrypting the copyright-related information and to store the ciphertext information in the blockchain;
obtaining the ciphertext information from the blockchain; and
performing obfuscation on a pixel matrix of the original image based on the ciphertext information to generate a target image carrying the copyright-related information, by:
encoding the ciphertext information to obtain a binary string corresponding to the ciphertext information;
inserting at least one character of the binary string into the pixel matrix according to a set character spacing; and
dividing the pixel matrix into a plurality of pixel regions according to a set dividing rule, and inserting the binary string into at least one of the pixel regions; or
dividing the pixel matrix into a plurality of pixel regions according to a set dividing rule, and inserting a portion of the binary string into each of the pixel regions.
12. The storage medium of claim 11 , wherein the performing obfuscation on a pixel matrix of the original image based on the ciphertext information further comprises:
using the binary string to replace redundant pixels in the pixel matrix according to a set replacing rule.
13. The storage medium of claim 11 , wherein the operations further comprise:
recording process information of performing obfuscation on the pixel matrix; and
sending the process information to the one or more blockchain nodes for storing in the blockchain.
14. The storage medium of claim 11 , wherein the copyright-related information further comprises:
current time information;
current geographic location information; or
identification information of the computing device.
15. The storage medium of claim 11 , wherein the copyright-related information further comprises copyright owner information of a copyright owner corresponding to the original image, wherein the copyright owner information comprises:
a name of the copyright owner; or
an ID number of the copyright owner.