irc-bitmap/README.md

39 lines
1.5 KiB
Markdown
Raw Normal View History

2019-01-11 21:14:23 +00:00
# irc-bitmap
2019-01-11 21:36:59 +00:00
A format for sending IRC bitmaps inline.
## Format
2019-01-11 21:57:45 +00:00
The format string shall be (in Python syntax) `r'<i([^-]+)-([^-]*)-([0-9A-Fa-f]+)>'`.
2019-01-11 21:36:59 +00:00
2019-01-11 21:57:45 +00:00
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).
2019-01-11 21:36:59 +00:00
The second capture group (may be empty) shall be known as the header and its syntax shall be defined by the format.
2019-01-11 21:36:59 +00:00
2019-01-11 21:57:45 +00:00
The third capture group contains the image data and is defined by the format.
2019-01-11 21:36:59 +00:00
2019-01-11 21:57:45 +00:00
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.
While there is no theoretical limit to the size of the image you can send, you are bound by any message length limits your server sets, as the entire part MUST fit in one message.
2019-01-11 21:36:59 +00:00
## Recognized formats
### `gb` - GameBoy 2BPP 4-shade monochrome
For an explanation of the format, see [here](http://www.huderlem.com/demos/gameboy2bpp.html).
The header has this syntax: `r'(\d+).(\d+)'`. The first and second capture groups specify the width and height in 8x8 tiles.
2019-01-11 21:57:45 +00:00
The third capture group
2019-01-11 21:36:59 +00:00
Example line: `<igb-1.1-FF007EFF858189839385A58BC9977EFF>`
Results in:
![Pokemon Red window](https://ttm.sh/qX.png)
### `raw` - Raw arbitrary bitmaps
2019-01-11 21:36:59 +00:00
8x8, 2 shade monochrome
2019-01-11 21:36:59 +00:00
Example line: `<iraw-8.8.1-FF818181818181FF>`
2019-01-11 21:36:59 +00:00
Results in:
![box](https://ttm.sh/qy.png)