I have been tasked with overlaying a photo on to a newspaper-esque image where the photo is of a person and they are meant to be the photo on the front of a newspaper.
I used codeigniter image library to watermark the template with the photo. It works fine but it distorts or removes some of the pixels in the photo when its overlayed
You can see it in the top left of the photo here-
I am also resizing the image up as its 500 px and the space for the image in the template is around 1400px
Here is the code i am using to overlay the image
private function overlay($template, $source_image)
{
echo $template;
// $config = array();
$config['source_image'] = $template;
$config['image_library'] = 'gd2';
$config['wm_type'] = 'overlay';
$config['wm_overlay_path'] = $source_image;
$config['wm_vrt_alignment'] = 'top';
$config['wm_hor_alignment'] = 'left';
$config['wm_hor_offset'] = '18px';
$config['wm_vrt_offset'] = '843px';
$config['quality'] = '100%';
$this->image_lib->initialize($config);
$result = $this->image_lib->watermark();
if($result){
return $result;
}
else
{
echo $this->image_lib->display_errors();
return false;
}
}