parent
2f514bc235
commit
d624e6ba09
35
README.md
35
README.md
|
@ -4,13 +4,13 @@ A format for sending IRC bitmaps inline.
|
|||
|
||||
## Format
|
||||
|
||||
The format string shall be (in Python syntax) `r'<i([^-]+)-([^-]*)-([0-9A-Fa-f]+)>'`.
|
||||
The format string shall be (in Python syntax) `r'<i([^-]+)-([^-]*)-(.*)'`.
|
||||
|
||||
The first capture group shall be a format. The currently recognized formats are `gb` and `raw`, though any format can be used. A program SHOULD gracefully report and exit on an unknown or unsupported format. The identifier of a format may not include a hyphen (dash).
|
||||
The first capture group shall be a format. The currently recognized formats are `gb`, `r16`, and `r85`, though any format can be used. A program SHOULD gracefully report and exit on an unknown or unsupported format. The identifier of a format may not include a hyphen (dash).
|
||||
|
||||
The second capture group (may be empty) shall be known as the header and its syntax shall be defined by the format.
|
||||
|
||||
The third capture group contains the image data and is defined by the format.
|
||||
The third capture group contains the image data, shall be known as the payload, and is defined by the format.
|
||||
|
||||
Upon receiving a message containing the part, a compliant client MAY take steps to attempt a conversion to PNG or similar, or display the image inline. A thread with timeout CAN and SHOULD be used.
|
||||
|
||||
|
@ -24,16 +24,35 @@ For an explanation of the format, see [here](http://www.huderlem.com/demos/gameb
|
|||
|
||||
The header has this syntax: `r'(\d+).(\d+)'`. The first and second capture groups specify the width and height in 8x8 tiles.
|
||||
|
||||
The third capture group
|
||||
The payload is a hexadecimal representation of the image data. It has this syntax: `r'([0-9A-Fa-f]+)'`.
|
||||
|
||||
Example line: `<igb-1.1-FF007EFF858189839385A58BC9977EFF>`
|
||||
Results in:
|
||||
![Pokemon Red window](https://ttm.sh/qX.png)
|
||||
|
||||
### `raw` - Raw arbitrary bitmaps
|
||||
### `r16` - Raw arbitrary bitmaps, hexadecimal-encoded
|
||||
|
||||
8x8, 2 shade monochrome
|
||||
The header has this syntax: `r'(\d+).(\d+).(\d+)'`. The first and second capture groups specify the width and height of the image and the third group specifies the bitdepth.
|
||||
|
||||
Example line: `<iraw-8.8.1-FF818181818181FF>`
|
||||
The payload is a hexadecimal representation of the image data. It has this syntax: `r'([0-9A-Fa-f]+)'`.
|
||||
|
||||
8x8, monochrome
|
||||
|
||||
Example line: `<irawhex-8.8.1-FF818181818181FF>`
|
||||
Results in:
|
||||
![box](https://ttm.sh/qy.png)
|
||||
![box](https://ttm.sh/qy.png)
|
||||
|
||||
### `ra85` - Raw arbitrary bitmaps, (Adobe) ascii85-encoded
|
||||
|
||||
The header has this syntax: `r'(\d+).(\d+).(\d+)'`. The first and second capture groups specify the width and height of the image and the third group specifies the bitdepth.
|
||||
|
||||
The payload is an (Adobe) ascii85-encoded representation of the image data. It has this syntax: `r'(<~[!-uz]+~>)'`.
|
||||
|
||||
8x8, monochrome
|
||||
|
||||
See https://en.wikipedia.org/wiki/Ascii85#Example_for_Ascii85 for the encoding. See `ruby-ascii85` package in Debian for an implementation. TODO: see https://www.dcode.fr/ascii-85-encoding for a non-Adobe implementation that will save at least four bytes.
|
||||
|
||||
Example line: `<ira85-8.8.1-<~?t'(dJUrB'Jc>~>`
|
||||
Results in:
|
||||
![box](https://ttm.sh/qy.png)
|
||||
|
||||
|
|
Loading…
Reference in New Issue