3 ms·
Not speaking about processing costs, this could be nice format for storing the data. Consider the example from page: 1 2 3 4 5 6 7 a · 1 2 · · · · b ·
by myfonj 12y ago
Not speaking about processing costs, this could be nice format for storing the data. Consider the example from page:
1 2 3 4 5 6 7
a · 1 2 · · · ·
b · A # # · · ·
c · · # # # · ·
e · · · 9 # 3 ·
f · · · 8 # 4 ·
h · · # # # · ·
i · 7 # # · · ·
j · 6 5 · · · ·
It is textually 58 characters of data:
7 ·12·····A···············9·3····8·4·········7······65····
(Axis headers and whitespace ommited, two characters added to keep the row width information.)
It is almost the same size of the smallest possible SVG polygon of similar shape consisting of 59 characters:
data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"><polygon points="0,0 2,0 5,3 5,5 2,8 0,8 0,6 2,5 2,3 0,2"/></svg>
Using even the simplest coordinates notation it could look like 24 characters:
a2a3e6f4j5j6i7f6e9b2f cf
(Three characters added to keep "Close and fill" information.)
Smallest 7×8 px PNG with the same image is 96 bytes large:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAIAQMAAAAPyndFAAAABlBMVEX///8AAABVwtN+AAAAFUlEQVQI12NIYChgsGCQAUILICsBABJQAkm4hriIAAAAAElFTkSuQmCC
- charles_parnot 12y agoNice to see the actual comparison of the binary size (and there is the 2x and 3x png). On the other hand, to be fair, the memory footprint will be more with the ASCII version (text + final NSImage loaded as bitmap in memory) compared to png (only the bitmap in memory, directly loaded from disk). The size of the bitmap is big anyway: there is no compression.