Sydney Image Format is a small, simple, work in progress image format.
All numbers are stored in hex, and 1 byte long unless stated otherwise.
The header of any SIF file should always be as follows. It should always be 8 bytes long.
53 49 46 32 2E 30 00 00
Which is hex for
SIF2.0
This should have a header like below, and should be 4 bytes long.
F9 80 71 00
The first byte is the amount of color entries in our table. The second byte is the width of the image in pixels. The third byte is the height of the image in pixels. The fourth byte remains empty.
The first entry in the color table should always be 00 00 00 00
A color entry looks like this, after the header:
DF 3B 26 FE
It translates to
[1 BYTE RED][1 BYTE GREEN][1 BYTE BLUE][1 BYTE ALPHA]
Every color will have it's own entry, back to back.
Instead of writing the X and Y value for every pixel, I've chosen to write each pixel in order. The logic for this is as below.
Each pixel is written in order on the image, from (0, 0) to the end of the image. Each pixel is written as 1 byte, and that byte being the number for the color to use in the color table.
Read the Y value, and go across until your index reaches that of the Y value. You now have read 1 row of the image. A hex editor can help show this on some images.