2011-06-17 86 views

回答

3

試試下面的代碼

給你的顏色代碼GD功能IMG_FILTER_COLORIZE

$imgname = "source.png";   
    $im = imagecreatefrompng ($imgname);    
    if($im && imagefilter($im, IMG_FILTER_COLORIZE, 137, 113, 79))    
    { 
     echo 'Image successfully shaded green.';     

     imagepng($im, 'result.png');    
     imagedestroy($im);      
    }     
    else    
    { 
     echo 'Green shading failed.'; 
    }