to create a compatible parser, you must follow these rules when reading or writing a bioif file
the file must use utf-8 encoding
the file must have a ".bioif" file extension
the file must start with the following heading, then a line break (\n):
"hi human. this file is encoded with the bioif format. in case you're wondering what that stands for, it means "bsb.dev's incredibly optimised image format". in order to read this file you must have a compatible parser. there's one available over at image.bsb.dev if you just opened this in a text editor! anyway after this bit there will be instructions on how to read the file. if you don't want to use a parser, lucky for you - these files are human readable too. after these sentences will be some nice instructions asking the computer to display some pixels, i'm sure you can write down them on paper or something. you know hex colors right?"
if this header is not present in its entirety then the image should be considered corrupted
the file must then have a line with information about the image in this format:
"first things first. the image's resolution is <X_PIXELS> by <Y_PIXELS>. it is using <VERSION> of the bioif format. now let's get to the image itself shall we?"
<X_PIXELS> - the width of the image in pixels.
<Y_PIXELS> - the height of the image in pixels.
<VERSION> - the bioif format used. currently only "v1.0" is acceptable
the file must then have a line for every pixel in this format:
<HEX_COLOR> - the hex color of that pixel, with a hashtag symbol at the beginning. it must use capital letters.
<PHONETIC_SPELLING> - HEX_COLOR but spelt out using the phonetic alphabet.
each phonetic word must begin with a capital letter.
arbitrary text is allowed between each capitalised word.
the phonetic spelling must be checked for accuracy to prevent data errors.
any arbitrary text must be in lowercase. it can contain any symbol except the hashtag (#) symbol. numbers are allowed.
a compatible example would be the following:
"ok so for this pixel i want you to do the following color: #FFF12E. in case you didn't get that it's Foxtrot Foxtrot Foxtrot One Two Echo. you could describe it as a bright yellow"
the file must end with the following footer:
"whew! done! that's all the pixels finished now. if you're a computer then this is your sign to finish up the parsing. and for the humans that got to the end of this file - admire your work. you are the parser now. breath in the achievement of painstakingly recreating every single pixel of an image."
if this footer is not present in its entirety then the image should be considered corrupted
it is recommended to write your own files as prose
localisation may be supported in a future version
an example file
this file is a 2x2 image containing a white, red, green and blue pixel.
it was handwritten as the guidance suggests.
an example parser
this website contains bioif-parser.js, a module to convert between bioif and png/jpg.
here you can test the module. ideally however you should write your own prose ;)
this module is not very fast for some reason i cant tell why
image to bioif
bioif to image
the license
this project is licensed under the MIT license
however the header contains attribution so any valid parser has to credit me anyway :)