Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    Join Date
    Dec 2009
    Location
    Indianapolis
    Posts
    31
    Thanks
    6
    Thanked 0 Times in 0 Posts

    png 24 copy/re-color fuzzy edges

    hello all,

    i have a function to copy a png 24 while preserving transparency and recolor the image and save a new file. the color works but the image edges become fuzzy. i'm not entirely sure what is causing this. i'd like to have the same quality as the original image with clean edges. love to hear suggestions. thanks a lot


    PHP Code:
     <?php   function color_png($src_string$directory$r$g$b){

    $im imagecreatefrompng($src_string);
    imageantialias($imtrue);

    $width imagesx($im);
    $height imagesy($im);
    $imn imagecreatetruecolor($width$height);
    imagealphablending($imn,false);
    $col=imagecolorallocatealpha($imn,255,255,255,127);
    imagesavealpha($imn,true);
    imagefilledrectangle($imn,0,0,$width,$height,$col);
    imagealphablending($imn,true);
    imagecopy($imn$im0000$width$height);
    imagefilter($imnIMG_FILTER_NEGATE);

    imagefilter($imnIMG_FILTER_COLORIZE$r$g$b);

    imagepng($imn$directory);
    imagedestroy($imn);


    }

    ?>
    Last edited by kirkh34; 10-09-2012 at 05:25 AM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •