Anti-aliasing ASCII art
Ruby, 180 168 characters
gets
w=1+gets.to_i
f=*(readlines*&quot;&quot;).chars
f.zip(f[1..-1]+s=[&quot; &quot;],s+f,s*w+f,f[w..-1]+s*w){|a,*b|$&gt;&lt;&lt;&quot;@;V#{a}&gt;bF#{a}&lt;dY#{a*5}&quot;[a&gt;&quot; &quot;?(b.map{|y|y&gt;&quot; &quot;?1:0}*&quot;&quot;).to_i(2):3]}

Another Ruby implementation which takes a zip approach. You can see the second example running online.
Edit: Using readlines saves 12 characters.