808 posts
Posted 18 October 2012 - 06:27 AM
So with the coming advanced computers with color screens, I imagine colors and images are about to get a lot more important. I think we need a standardized format in which files are saved to represent ascii images with colors. This obviously requires three layers. One for the background color map, one for the text color map, and one for the text itself. I was thinking it could be just a three dimensional table serialized and saved to file. At the top though, there'd be a separate header table describing the dimensions of the file. After you unserialized the data table from the file though, you could use something like this to retrieve data:
dimensions = textutils.unserialize(file.readLine())
fileTable = textutils.unserialize(file.readLine())
fileTable[x][y][map]
The last line would provide the data for <map> at coordinates (x,y), the map again being either the background color, text color, or text itself.
The reason this would be nice is because any program that wants to use anyone else's image can do so easily without storing the data in the program file itself like an idiot.
anyone got any better ideas?
294 posts
Posted 18 October 2012 - 08:51 AM
I think current "standard" format is .nfp - 3 paint programs support it (although I'm not sure about AutomaPaint).
231 posts
Posted 18 October 2012 - 08:54 AM
A bit of a self-plug, but you may want to check of my
CBM format which was created for the purpose of a universal image format. No-ones adopted it yet, but it has support for transparency and I'm working on animation. (And its smaller than text-based formats.)
389 posts
Location
Norway
Posted 18 October 2012 - 09:54 AM
The standard format is indeed the one that is in Paint 2.0, nPaintPro etc. Where the colors are stored with their hex and " " is transparent. IE a 16pixle color test
0123
4567
89ab
cdef
How you load it is up to you, but there will be support for this in imageutils.
294 posts
Posted 18 October 2012 - 11:28 AM
Cruor what is official name of that format? I am calling it NFP because that is how nitrogenfingers named it, but I'm sure there is better name.
I like CBM because it's smaller (byte instead of text), but NFP is more readable and you can even edit it with text editor.
389 posts
Location
Norway
Posted 18 October 2012 - 11:54 AM
Cruor what is official name of that format? I am calling it NFP because that is how nitrogenfingers named it, but I'm sure there is better name.
I like CBM because it's smaller (byte instead of text), but NFP is more readable and you can even edit it with text editor.
writing it as 1111 uses 4 times the space as writing it as f, because its stored as chars and not bit
also it is called .img by dan or something o_o
1054 posts
Posted 18 October 2012 - 12:44 PM
Cruor what is official name of that format? I am calling it NFP because that is how nitrogenfingers named it, but I'm sure there is better name.
I like CBM because it's smaller (byte instead of text), but NFP is more readable and you can even edit it with text editor.
writing it as 1111 uses 4 times the space as writing it as f, because its stored as chars and not bit
also it is called .img by dan or something o_o
He didn't mean that the values are written as binary :P/>/>. He meant that they aren't stored as ascii-values, but just as a binary value (e.g. 0xf). But in fact, they are equal in size (except for the headers probably).
294 posts
Posted 18 October 2012 - 12:46 PM
No it IS actual binary file
http://pastebin.com/69W2E4QdOne byte can store 2 hex values in binary mode or 1 character in text mode (as with other formats) so binary format have potential to be 2x more efficient (I did not accurately checked CBM code so I'm not sure how it works)
389 posts
Location
Norway
Posted 18 October 2012 - 12:50 PM
well, then you cant open the file in edit :P/>/>
1054 posts
Posted 18 October 2012 - 12:52 PM
well, then you cant open the file in edit :P/>/>
You can, but it will all be question marks :)/>/> anyways, as they are equal in size, the use of ascii chars is a much better choice.
288 posts
Location
The trashcan where all Undertale trash is
Posted 18 October 2012 - 03:18 PM
I like this idea. I wish I knew how to make one :P/>/>