#!/bin/sh
-convert -compress none -resize 66x23 - pgm:- |
-perl -nE '
-$_ eq "P2\n" or die "ascii pgm input required\n" if $. == 1;
-next if $. <= 3;
+convert -compress none +distort SRT '0,0 1,.56 0' -thumbnail ${1:-66x23} - pgm:- |
+perl -e '
+<> eq "P2\n" or die "ascii pgm input required\n";
+<>; <>; # ignore depth, dimensions
-state @ch = split //, " .oO@";
-print $ch[ $_ / 256 * @ch ] for /\d+/g;
-print $/;
+my @ch = split //, " .:coO@";
+while (<>) {
+ print $ch[ $_ * @ch >> 8 ] for /\d+/g;
+ print $/;
+}
'