$img = ImageCreateFromJpeg('logo.jpg'); // get height and with of the image. $width = imagesx($img); $height = imagesy($img); echo '
';
for($h=0;$h<$height;$h++){
 for($w=0;$w<=$width;$w++){
  if($w == $width){
   echo '
'; continue; } // get image at pixel location $rgb = ImageColorAt($img, $w, $h); // convert colour into usable format $r = ($rgb >> 16) & 0xFF; $g = ($rgb >> 8 ) & 0xFF; $b = $rgb & 0xFF; // check for white/off-white colour if($r > 200 && $g > 200 && $b > 200){ echo ' '; }else{ echo '#'; } } } echo '