lfg-format
⸺ by Charles Iliya Krempeaux
The lfg-format is meant to not only be , , and , but — it is also meant to be .
I.e., not only is the lfg-format meant to be easy for (non-programmer) humans, programmers, and machines (i.e., computers) to read and understand it, but — it is also meant to be easy for a (non-programmer) human to create and edit them in a .
These concerns are placed higher than other concerns, such as file-size minimization. (Compression and other concerns are handled at other levels.)
Name
"LFG" is an initialization of "legible friendly graphics".
"Modernized"
One way to think of the lfg-format is — what if you were going to try to "modernize" the data-format used to create and .
The intent behind the lfg-format is — it should be a easy to create an lfg-format image as it is to create and .
Related Formats
The lfg-format is somewhat (also) similar to the , the , the , the , and the — in that they are also meant to create and edit them in a .
Example
Here is an example lfg-format image:
LFG/1 8 16 25 #55ffff ■ #ff55ff □
■■■■■■■■ ■□□■■■■■ ■□□■■■■■ ■□□■■■■■ ■□□■■■■■ ■□□■■■■■ ■□□■■■■■ ■□□■■■■■ ■□□■■■■■ ■□□■■■■■ ■□□■■■■■ ■□□■■■■■ ■□□■■■■■ ■□□□□□□□ ■□□□□□□□ ■■■■■■■■
A lfg-format image is a file that starts with the "magic" on the first line:
LFG/1
(The "LFG" has to be a letters.)
Next comes the width of the image data. In the case of this example, the width is:
8
After that comes the height of the image data.. In the case of this example, the height is:
16
(And thus the image data will be 8×16.)
And then after that comes magnification. In the case of this example, the magnification is:
25
(And thus, even though our image data will be 8×16, the actual image will be 200×400 — because 8 times 25 equals 200, and 16 timrs 25 equals 400.)
After that comes the , which includes the character used for that color. In the case of this example, it is:
#55ffff ■ #ff55ff □
Our example only has 2 colors. But we could have used more or less colors than the number of colors this example had.
We know then the rows end because there will be a single empty line.
After that is the image data. In the case of this example, it is:
■■■■■■■■ ■□□■■■■■ ■□□■■■■■ ■□□■■■■■ ■□□■■■■■ ■□□■■■■■ ■□□■■■■■ ■□□■■■■■ ■□□■■■■■ ■□□■■■■■ ■□□■■■■■ ■□□■■■■■ ■□□■■■■■ ■□□□□□□□ ■□□□□□□□ ■■■■■■■■
End-Of-Line
- LF (U+000A) (line-feed)
- NEL (U+0085) (next-line)
- LS (U+2028) (line-separator)
The CR (U+000D) character is ignored.
(We care about end-of-line characters for the magic line, the width line, and height line, the magnification line, and color lines, and the empty line after the the color lines — but don't care about end-of-line characters after that.)
Image Data
and spacing characters within image data is not significant.
For example, this is the same image as before:
LFG/1 8 16 25 #55ffff ■ #ff55ff □
■■■■■■■■■□□■■■■■■□□■■■■■