HermannSW 2700006U54 Tags:  pbmtobraille unicode braille terminal datapower non-xml dot xslt netpbm image graphviz 2 Comments 14,367 Views
HermannSW 2700006U54 Tags:  image datapower non-xml dot xslt unicode pbmtobraille netpbm graphviz braille terminal 7 Comments 19,783 Views
"ws & comments":"http://www.fileformat.info/format/pbm/egff.htm"
This week I retweeted a last April tweet I stumbled across:
This looked really interesting to me, graphviz dot tool drawing output "inside" the terminal:
I wanted to be able to do same or similar [of course store as file and view via gimp or browser is possible].
Back in 2011 I gave 2 WSTE webcasts on "Non-XML Data Processing in WebSphere DataPower SOA Appliances Stylesheets". The 2nd webcast shows on slide 28 how I did convert a bitmap image into textual output making use of the Braille Patterns.
This is the conversion for snowman.pbm, .pbm is portable bitmap format from netpbm tools:
Typically only the top 2x3 dots of 2x4 get used, as you can see above I used all 2x4.
Here are the numbering of the dots as well as the hex codes are specifed:
There are tons of converters between different formats in netpbm tools, as well as modifiers (like eg. pnmcrop).
In this blog posting I will now talk about new pbmtobraille tool I created.
You find the C source, a syntax highlighted version and sample outputs generated in pbmtobraille.zip for download.
pbmtobraille.c[.pre.html] is a small C program (97 lines without comments containing sample outputs) doing just what it says:
pbmtobraille.c.html is just the syntax highlighted version.
samples.txt[.pre.html] contains various sample output produced (shown below), which are part of pbmtobraille.c's comments too.
9x9.pbm is a really crazy parsing sample according the .pbm spec, following this statement:
This is the header section demonstrating basic use with pbmtext output, including negation of generated output, as well as the help line telling the tool's features:
This is top of tail comment section, showing graphviz output done by pbmtobraille:
And finally this is bottom section showing a bigger layout in vertical direction (layout=TB is default, Top to Bottom):