function mergeFrontBack($img_front, $img_back, $final_output, $x, $y, $imagick=FALSE) { if($imagick) { $overlay = new Imagick($img_front); $bg = new Imagick($img_back); $temp_image = new Imagick(); $d = $overlay->getImageGeometry(); $w = $d[‘width’]; $h = $d[‘height’]; $bg_temp = $this->prefixToImg(‘_temp’,$bg); $bg_copy = $this->prefixToImg(‘_copy’,$bg); $temp_image->newImage($w, $h, new ImagickPixel(‘white’)); $temp_image->setImageFormat(‘png’); $temp_image->writeImage($bg_temp); // Set the colorspace to the same value $temp_image->setImageColorspace($bg->getImageColorspace()); //Second image is […]