diff options
author | Akshay <[email protected]> | 2021-02-26 04:47:12 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2021-02-26 04:47:12 +0000 |
commit | 7979dd9cc3d2c3c2782cdabc2411b3acf7b7d5f2 (patch) | |
tree | 3daf3f78f75c1c95767be76cf028bc5ca951addf /spec.md |
init with spec info
Diffstat (limited to 'spec.md')
-rw-r--r-- | spec.md | 45 |
1 files changed, 45 insertions, 0 deletions
@@ -0,0 +1,45 @@ | |||
1 | # One Bit Image | ||
2 | |||
3 | The One Bit Image is a file format to store single bit depth | ||
4 | images, similar to 1-bit BMP files. It is a learning | ||
5 | adventure and does not aim to be ubiquitous or | ||
6 | well-performing. The name is shortened to `obi`, any files | ||
7 | that wish to be identified as this format may use the file | ||
8 | extension `.obi`, for example: `apple.obi`. | ||
9 | |||
10 | ## Technical Specification | ||
11 | |||
12 | The 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 | |||
20 | This header contains the following metadata about the file | ||
21 | itself: | ||
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 | |||
30 | This 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 | |||
44 | The image data. Each pixel is a single bit, the size of | ||
45 | Pixel Data is given by `Width * Height`. | ||