Search

US-12619813-B1 - Encoding and decoding text and data as color grids with metadata for efficient decoding

US12619813B1US 12619813 B1US12619813 B1US 12619813B1US-12619813-B1

Abstract

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.

Inventors

  • Louis Cornelius Hamann

Assignees

  • Louis Cornelius Hamann

Dates

Publication Date
20260505
Application Date
20250703

Claims (17)

  1. 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. 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. 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. 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. 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. 6 . The method of claim 1 , further comprising storing the image file in a format that supports metadata embedding, compatible with electronic transmission.
  7. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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.

Description

FIELD OF TECHNOLOGY The present disclosure relates generally to database systems and data processing, and more specifically to encoding text and data as color grids with metadata for efficient decoding. BACKGROUND Efficient storage and transmission of text and structured data are critical in the field of computing. Encoding schemes such as the American Standard Code for Information Interchange and Unicode may represent characters as binary data, enabling digital systems to process and store textual information. Compression algorithms may be employed to reduce file sizes, optimizing storage and transmission. Image-based encoding techniques may also be used to embed information into visual formats, leveraging the ability of images to represent complex data structures compactly. Attempts have been made to convert data, such as a program file, in color grids, however, the decoding was either not considered or appeared to contain unacceptable decoding errors. SUMMARY The described techniques relate to improved methods, systems, devices, and apparatuses for encoding text and data as color grids with metadata for efficient decoding. Some implementations may provide a method for encoding text and structured data as color grids, leveraging a dynamically generated dictionary that maps words, phrases, or tokens to distinct color values in a color space such as Red-Green-Blue (RGB) or Red-Green-Blue-Alpha (RGBA) values. The encoded data may be stored as an image file, with the dictionary appended as metadata which may be in a human-readable format, such as JavaScript Object Notation (JSON). This approach may ensure deterministic decoding, as the dictionary may provide a one-to-one mapping between colors and their corresponding data elements. The method may support both static and dynamically generated dictionaries, enabling efficient encoding of diverse datasets, including text, programming code, and structured data. The encoded image may be processed using both central processing units, graphics processing units or dedicated hardware, significantly accelerating decoding and execution. The method may also support additional features, such as the use of the alpha channel in RGBA to encode contextual or semantic information, ensuring that the encoded data retains its original structure and meaning. The compact nature of the color grid may allow for substantial reductions in storage size, while the appended dictionary may ensure that each encoded file is self-contained and secure. This innovation may address the limitations of existing methods, offering a scalable, efficient, and versatile solution for data encoding and transmission across a wide range of applications. A method for encoding text and data as color grids with metadata for efficient decoding is described. The method may include 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 dictionary mapping classified tokens and compounded phrases to corresponding distinct color values. The method may include 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. The method may include storing the color grid as an image file with appended metadata comprising the dynamically generated dictionary for deterministic decoding of text or structured data. A system configured for encoding text and data as color grids with metadata for efficient decoding the system comprising an encoding platform and a decoding platform is described. The encoding platform may include a processor and memory coupled with the processor. The system may include instructions stored in the memory and executable by the processor to cause the system to receive text or structured data and perform 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. The system may assign distinct color values in a color space to atomic tokens and compounded phrases based on a dynamically generated dictionary, the dictionary mapping classified tokens and compounded phrases to corresponding distinct color values. The system may assemble a color grid by placing assigned distinct color values into a grid format according to a predefined reading rule and generate metadata comprising the dynamically generated dictionary. The system may store the color grid as an image file with appended metadata comprising the dynamically generated dictionary for deterministic decoding of text or structured data. Another system for encoding text and dat