*
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What the Fuck You Want
* to Public License, Version 2, as published by Sam Hocevar. See
* http://www.wtfpl.net/ for more details.
*/
$src = "logo-caca.png";
$img = imagecreatefrompng(dirname(__FILE__)."/".$src);
if (!$img) {
die("Can not open image.\n");
}
$dither = caca_create_dither($img);
if (!$dither) {
die("Can not create dither. Maybe you compiled caca-php without gd support.\n");
}
$canvas = caca_create_canvas(100, 40);
caca_dither_bitmap($canvas, 0, 0, caca_get_canvas_width($canvas), caca_get_canvas_height($canvas), $dither, $img);
echo caca_export_string($canvas, "html3");
echo "";
?>