rewrite png2ansi by Perl