aboutsummaryrefslogtreecommitdiff
path: root/spec.md
diff options
context:
space:
mode:
Diffstat (limited to 'spec.md')
-rw-r--r--spec.md45
1 files changed, 0 insertions, 45 deletions
diff --git a/spec.md b/spec.md
deleted file mode 100644
index 7f455e2..0000000
--- a/spec.md
+++ /dev/null
@@ -1,45 +0,0 @@
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`.