if (isset($_GET['file'])) { $file = $_GET['file']; } else { $file = '2'; } if (isset($_GET['threshold'])) { $threshold = floatval($_GET['threshold']); } else { $threshold = 0.25; } $img = 'test/' . $file . '.png'; $x = 8; $y = 16; $pdir = 'patterns/ansi/'; foreach ($chars as $index => $char) { courierimage($char, $x, $y, $pdir); } ?> <pre> <?php //echo 1%1; //echo $charstring; ?> </pre> <table><tr><td> <pre> <?php echo chop_png($img, $pdir, $x, $y, $threshold); //echo show_chopped(); ?> </pre>
// echo $value.'<br />'; $output .= "{$value}"; } } return $output; } function print_img_array($arr) { $output = '<pre>'; foreach ($arr as $yarr) { foreach ($yarr as $color) { switch ($color) { case 0: $output .= "<span class=\"zero\">0</span>"; break; case 1: $output .= "<span class=\"one\">1</span>"; break; } } $output .= "\n"; } return $output . '</pre>'; } if (isset($_GET['char'])) { $char = $_GET['char']; } else { $char = '█'; } courierimage($char, 8, 16, 'temp/');