Encoding and decoding text and data as color grids with metadata for efficient decoding
View Patent ↗Methods, systems, and devices for encoding text and data as color grids with metadata for efficient decoding are described. In some implementations, a server may receive text or structured data and perform tokenizing and lexical analysis of the data for arranging the data into a stream of classified tokens comprising atomic tokens and compounded phrases. The server may assign distinct color values of a color space to these tokens and phrases based on a dynamically generated dictionary, which may map tokens and phrases to corresponding color values. The server may then assemble a color grid by placing the assigned color values into a grid format according to a predefined reading rule. The color grid may be stored as an image file with appended metadata comprising the dynamically generated dictionary for deterministic decoding.
1 . A method for encoding text and data as color grids with metadata for efficient decoding, and transmission, comprising: receiving text or structured data and performing tokenizing and lexical analysis of the text or structured data for arranging the text or structured data into a stream of classified tokens comprising atomic tokens and compounded phrases; assigning distinct color values in a color space to atomic tokens and compounded phrases based on a dynamically generated dictionary, the dynamically generated dictionary mapping classified tokens and compounded phrases to corresponding distinct color values; assembling a color grid by placing assigned distinct color values into a grid format according to a predefined reading rule and generating metadata comprising the dynamically generated dictionary; and storing the color grid as an image file with appended metadata comprising the dynamically generated dictionary for deterministic decoding of text or structured data; wherein the color space is RGBA and wherein the metadata includes a predefined alpha channel value for RGBA colors that distinguishes atomic tokens comprising keywords and operators within the text or structured data.
2 . The method of claim 1 , further comprising performing a collision check to ensure that assigned color values for atomic tokens and compounded phrases are sufficiently distinct from one another based on a predefined color distance threshold to prevent decoding errors during reconstruction of the text or structured data.
3 . The method of claim 1 , further comprising appending metadata to the image file that includes positions in the color grid of color values configured to define the reading rule specifying a positional arrangement of color values within the color grid that when decoded are defining an organized sequence for decoding the color grid.
4 . The method of claim 1 , further comprising encoding compounded phrases by blending color values of individual tokens within the compounded phrases to generate unique color values that are mapped to the dynamically generated dictionary.
5 . The method of claim 1 , further comprising generating the dynamically generated dictionary in a compressed format that includes mappings of color values to tokens and phrases, as well as metadata specifying language settings and syntax rules for decoding.
6 . The method of claim 1 , further comprising storing the image file in a format that supports metadata embedding, compatible with electronic transmission.
7 . The method of claim 1 , further comprising printing the color grid on a physical medium and transmitting the physical medium along with the dynamically generated dictionary.
8 . The method of claim 7 , wherein the color grid is printed as a plurality of grayscale grid each grayscale grid corresponding to a color channel in the color space.
9 . The method of claim 1 , wherein the dynamically generated dictionary includes mappings for compounded phrases that are identified in response to detecting repeating patterns within the text or structured data.
10 . A system configured for encoding and decoding text and data as color grids with metadata for efficient decoding, comprising an encoding platform and a decoding platform, the encoding platform comprising: a processor; memory coupled with the processor; and instructions stored in the memory and executable by the processor to cause the system to: receiving text or structured data and performing tokenizing and lexical analysis of the text or structured data for arranging the text or structured data into a stream of classified tokens comprising atomic tokens and compounded phrases; assigning distinct color values in a color space to atomic tokens and compounded phrases based on a dynamically generated dictionary, the dynamically generated dictionary mapping classified tokens and compounded phrases to corresponding distinct color values; assembling a color grid by placing assigned distinct color values into a grid format according to a predefined reading rule and generating metadata comprising the dynamically generated dictionary; and storing the color grid as an image file with appended metadata comprising the dynamically generated dictionary for deterministic decoding of text or structured data; wherein the decoding platform comprises a hardware comprising: an input external memory configured for storing the image file with appended metadata comprising the dynamically generated dictionary; a memory cache configured for storing the dynamically generated dictionary; a set of parallel decoders grouped into clusters; a control logic configured to feed the parallel decoders with information from the external memory and the memory cache; and an output external memory configured to store the decoded text or structured data.
11 . The system of claim 10 , wherein the instructions are further executable by the processor to cause the system to: perform a collision check to ensure that assigned color values for atomic tokens and compounded phrases are sufficiently distinct from one another based on a predefined color distance threshold to prevent decoding errors during reconstruction of the text or structured data.
12 . The system of claim 10 , wherein the instructions are further executable by the processor to cause the system to: append metadata to the image file that includes positions in the color grid of color values configured to define the reading rule specifying a positional arrangement of color values within the color grid, that when decoded are defining an organized sequence for decoding the color grid.
13 . The system of claim 10 , wherein the instructions are further executable by the processor to cause the system to: encode compounded phrases by blending color values to generate unique color values for compounded phrases that are mapped to the dynamically generated dictionary.
14 . The system of claim 10 , wherein the instructions are further executable by the processor to cause the system to: generate the dynamically generated dictionary in a compressed format that includes mappings of the color values to atomic tokens and compounded phrases, as well as metadata specifying language settings and syntax rules for decoding.
15 . The system of claim 10 , wherein the instructions are further executable by the processor to cause the system to: store the image file in a format that supports metadata embedding, for electronic transmission to the decoding platform configured to retrieve the encoded text or structured data.
16 . The system of claim 10 , wherein the text or structured data is a source code of a program and wherein the decoding platform comprises an interpreter for reading the source code from the output external memory and executing the program.
17 . A non-transitory computer-readable medium storing code for encoding text and data as color grids with metadata for efficient decoding, the code comprising instructions executable by a processor for: receiving text or structured data and performing tokenizing and lexical analysis of the text or structured data for arranging the text or structured data into a stream of classified tokens comprising atomic tokens and compounded phrases; assigning distinct color values in a color space to atomic tokens and compounded phrases based on a dynamically generated dictionary, the dynamically generated dictionary mapping classified tokens and compounded phrases to corresponding distinct color values; assembling a color grid by placing assigned distinct color values into a grid format according to a predefined reading rule and generating metadata comprising the dynamically generated dictionary; and storing the color grid as an image file with appended metadata comprising the dynamically generated dictionary for deterministic decoding of text or structured data; wherein the color space is RGBA and wherein the metadata includes a predefined alpha channel value for RGBA colors that distinguishes atomic tokens comprising keywords and operators within the text or structured data.