From 504db3e5616a093cec0f1296306e533ce2577b13 Mon Sep 17 00:00:00 2001 From: Robert Miles Date: Fri, 11 Jan 2019 16:36:59 -0500 Subject: [PATCH] Add format spec --- README.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f6748e9..e886152 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,33 @@ # irc-bitmap -A format for sending IRC bitmaps inline. \ No newline at end of file +A format for sending IRC bitmaps inline. + +## Format + +The format string shall be (in Python syntax) `r''`. + +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 second and third capture groups are the width and height in 8x8 tiles. 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. + +The fourth capture group is a hexadecimal representation of the image data. + +Upon recieving a message containing the part, a compliant client MUST take steps to attempt a conversion to PNG or similar. A thread with timeout CAN and SHOULD be used. + +## Recognized formats + +### `gb` - GameBoy 2BPP 4-shade monochrome + +For an explanation of the format, see [here](http://www.huderlem.com/demos/gameboy2bpp.html). + +Example line: `` +Results in: +![Pokemon Red window](https://ttm.sh/qX.png) + +### `raw` - Raw 2-shade monochrome + +2 shade monochrome + +Example line: `` +Results in: +![box](https://ttm.sh/qy.png) \ No newline at end of file