i need to create a transparent image, then combine transparent pngs to it whilst maintaining image quality.
how can i do this?
imagecreatetruecolor(...);
//processing using imagecopymerge(..);
imagepng(...);
outputs a black background.
thanks :)
here's my actual code for reference...
$d = getimagesize(TMP.$this->files[0]);
$source_height = $d[0];
$source_width = $d[1];
$this->canvas = imagecreatetruecolor($source_width*count($this->files),$source_height);
imagealphablending($this->canvas, false );
$i=0;
foreach($this->files as $f){
$dst_x = $source_width*$i;
$im = imagecreatefrompng(TMP.$f);
imagecopyresampled ( $this->canvas , $im ,
$dst_x ,
$dst_y = 0 ,
$src_x = 0 ,
$src_y = 0 ,
$source_width ,
$source_height ,
$source_width ,
$source_height);
$i++;
imagepng($im,TMP.$i.".png");
if($i>3)break;
}
$fn = TMP."stiched_up_$i*$source_width.png";
imagesavealpha($this->canvas,TRUE);
imagepng($this->canvas,$fn);