aboutsummaryrefslogtreecommitdiff
path: root/readme.md
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-03-10 14:33:20 +0000
committerAkshay <[email protected]>2021-03-10 14:33:20 +0000
commit5fced94f8446f2c3875fa5973b3532403c9431a5 (patch)
tree412ac9dd58802921d406e13be803a09cbb93b450 /readme.md
parent3d25a69b686c68f463ba313b2da112df135f1f0c (diff)
rename spec to readme
Diffstat (limited to 'readme.md')
-rw-r--r--readme.md45
1 files changed, 45 insertions, 0 deletions
diff --git a/readme.md b/readme.md
new file mode 100644
index 0000000..7f455e2
--- /dev/null
+++ b/readme.md
@@ -0,0 +1,45 @@
1# One Bit Image
2
3The One Bit Image is a file format to store single bit depth
4images, similar to 1-bit BMP files. It is a learning
5adventure and does not aim to be ubiquitous or
6well-performing. The name is shortened to `obi`, any files
7that wish to be identified as this format may use the file
8extension `.obi`, for example: `apple.obi`.
9
10## Technical Specification
11
12The file format consists of the following sections:
13
14 - File Header: 10 bytes, 0x0000 - 0x00A0
15 - Image Information Header: 16 bytes, 0x00A0 - 0x01A0
16 - Pixel data: Variable, 0x1A0 - Variable
17
18### File Header (10 bytes)
19
20This header contains the following metadata about the file
21itself:
22
23 - OBI version (2 bytes, 0x0000)
24 - File size in bytes (4 bytes, 0x0020)
25 - Data offset: Offset from the beginning of the file to the
26 beginning of bitmap data (4 bytes, 0x0060)
27
28### Image Information Header (16 bytes)
29
30This header contains metadata about the image:
31
32 - Width: Horizontal size of the bitmap data in pixels (4
33 bytes, 0x00A0).
34 - Height: Vertical size of the bitmap data in pixels (4
35 bytes, 0x00E0).
36 - Compression Algorithm: The following types of compression
37 are supported: RLE, Kosinki etc. Set 0 if no compression
38 (4 bytes, 0x0120).
39 - Image size after compression (set 0 if no compression,
40 i.e., Compression=0). (4 bytes, 0x0160)
41
42### Pixel Data (ImageInformationHeader.Width * ImageInformationHeader.Height bytes)
43
44The image data. Each pixel is a single bit, the size of
45Pixel Data is given by `Width * Height`.