<?php

    $image_path 
'image3.jpg';
    
$image_precision 10;
    
    
// Récupération des informations de l'image
    
if(file_exists($image_path)) {
        
$image imagecreatefromjpeg($image_path);
        list(
$image_width$image_height) = getimagesize($image_path);
        
        echo 
"<table border=\"0\" style=\"background-color:#000;font-size:8px;border-collapse:collapse;font-family:mono;\">\n";
        for (
$i=$i $image_height $i $i $image_precision) {
            echo 
"\t<tr>";
            for (
$j=$j $image_width $j $j $image_precision) {
                
$rgb imagecolorat($image$j$i);
                
$r = ($rgb >> 16) & 0xFF;
                
$g = ($rgb >> 8) & 0xFF;
                
$b $rgb 0xFF;
                echo 
"<td style=\"color:rgb($r,$g,$b);height:8px;width:8px;\">&</span></td>";
            }
            echo 
"</tr>\n";
        }
        echo 
"</table>\n";
    }
?>