|
Haio 0.2.X
Homebrew Asset IO/CDN
|
Zedia Container Image Stream is an image transport format based on .ar (Unix files), designed for progressive image streaming over slow connections and low-performance hardware.
The header file contains exactly the text 000000000000.txt and should be the first one added to the Unix files. Inside the header, each \r\n contains the address of an image to be cut in decimal format and separated by unique space. Padding is not necessary and is considered base 10, but it can be useful to make it more human-readable.
Every character in the filename, except for the extension, must be a valid Base62 ASCII character. The total length of the filename must not exceed 16 characters, in accordance with the Unix .ar specification, and follows ZCIS naming conventions.
| char | Attribute | description | | :–: | :----—: | :-------— | | 0 | ORDER | ignored, it only serves to facilitate ar rc $(ls | sort) | T | TYPE | command to be executed during image decoding see more | XX | POSX | offset x in px | HH | POSY | offset y in px | WW | WIDTH | width in px (can be stretched to the original image) | HH | HEIGHT | height in px (can be stretched to the original image)
Base 62 is used to convert bits to ASCII text, considering 0-9, A-Z, and A-Z respectively. The following is a simple JavaScript encoding example.
Image names may specify WIDTH and HEIGHT independently. When the target dimensions differ from the image dimensions, the image is scaled using nearest-neighbor (pixel replication), preserving each source pixel's color without interpolation.
| Blit | Commit | Description |
|---|---|---|
| a | A | ⠛ Solid tint |
| b | B | ⠃ Vertical interlaced tint |
| c | C | ⠉ Horizontal interlaced tint |
| d | D | ⠁ Stippled tint |
| e | E | Erase Masking |
| file | content | description |
|---|---|---|
| 0000000000.txt | 0 0 128 128 | delimitation of the image within the container |
| 1e00002424.pcx | transparency mask | |
| 2B00002424.y4m | YUV image to be filled and displayed |
| file | content | description |
|---|---|---|
| 0000000000.txt | 0 0 128 128 | delimitation of the image within the container |
| 1e00002424.pcx | 128x128 transparency mask | |
| 2A00002424.ppm | 64x64 RGB image that will be stretched | |
| 3B00002424.ppm | 64x64 RGB image with the complementary pixels to form the full resolution |
These notes describe the current c++ encoder (library/codecs/zcis.cpp). They are not part of the standard above; where the two disagree, the standard is what needs a decision.
Two layers split by row parity, both scaled back up to the full canvas on display:
| member | stored | target | content |
|---|---|---|---|
| 000000000000.txt | 0 0 <width> <height>\r\n | ||
| 1A0000WWHH.ppm | W x H/2 | W x H | the even rows |
| 2B0000WWHH.ppm | W x H/2 | W x H | the odd rows |
Interleaving the two layers rebuilds the source exactly, so the split costs nothing: W x H/2 plus W x H/2 is the whole image. The first layer alone is a valid preview at half the bytes, line-doubled vertically. An image one pixel tall emits the base layer only.
The same split holds for a future 4:2:0 payload: each layer keeps W/2 x H/4 chroma, so both halves stay decodable on their own and together they restore the original chroma plane untouched. That needs height to be a multiple of 4.