Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-09-2012, 04:22 AM   PM User | #1
kirkh34
New Coder

 
Join Date: Dec 2009
Location: Indianapolis
Posts: 31
Thanks: 6
Thanked 0 Times in 0 Posts
kirkh34 is an unknown quantity at this point
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 04:25 AM..
kirkh34 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:29 AM.


Advertisement
Log in to turn off these ads.