From [[http://zurb.com/forrst/posts/Sharpen_Images_with_PHP_GD-DEr]]\\

This solution which acts as a sharpen-filter on GD image objects.
<code>
function imagesharpen( $image) {

 $matrix = array(
    	   array(-1, -1, -1),
    	   array(-1, 16, -1),
    	   array(-1, -1, -1),
    	   );
    
 $divisor = array_sum(array_map('array_sum', $matrix));
 $offset = 0; 
 imageconvolution($image, $matrix, $divisor, $offset);
    	
 return $image;
}
</code>

and claimed to be found in the comments section for ''imageconvolution'' on the PHP.net site

So a php app to go through a bunch of thumbnails and sharpen them would be
<code>
<?php

ini_set('max_execution_time', 0);

listFolderFiles('.');
ini_set('memory_limit', '-1');

function imagesharpen($image) {
 $matrix = array(
    	   array(-1, -1, -1),
    	   array(-1, 16, -1),
    	   array(-1, -1, -1),
    	   );
 $divisor = array_sum(array_map('array_sum', $matrix));
 $offset = 0; 
 imageconvolution($image, $matrix, $divisor, $offset);
 return $image;
}

function sharpen($source,$Quality,$mime) {
 $org = getimagesize($source);

 if ( $mime == 'image/png' ) $from = imagecreatefrompng($source);
 else $from = imagecreatefromjpeg($source);
  imagesharpen($from);
  try {
   if ( $mime == 'image/png' ) imagepng($from, $source);
   else { imagejpeg($from, $source, $Quality); imagedestroy($from); }
  } catch (Exception $e) {
   echo 'Caught exception: ',  $e->getMessage(), "\n";
 }
}

function listFolderFiles($dir){
 $Allow = array('image/jpeg','image/png');
 $Quality = 80;
 
 $ffs = scandir($dir);
 foreach($ffs as $ff){
  if($ff != '.' && $ff != '..'){
   $what = $dir.'/'.$ff;
   if ( $mime =  mime_content_type($what) ) {
    if ( in_array($mime, $Allow) ) {
     $siz = getimagesize($what);
     echo $what ." \n" . $mime. " - " . $siz[0] . 'x'. $siz[1];
     echo "\n\n";
     sharpen($what,$Quality,$mime);
     echo 'Sharpen Success<br />'."\n";
    }
   }
   if ( $mime == 'directory' ) listFolderFiles($what);
  }
 }
}

?>
</code>

Use a **9** instead of a **16** in the middle of the matrix for minimal sharpening..