CodeIgniter Forums
Watermarking image with image overlay - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Watermarking image with image overlay (/showthread.php?tid=77941)



Watermarking image with image overlay - Hexes - 11-07-2020

Hello,

In CI3, I used to watermark images with an overlay of another image.

It looked like this: 
PHP Code:
   $this->load->library('image_lib');

                
$config['source_image']    = $filepath;
        
$config['image_library'] = 'GD2';
        
$config['wm_type'] = 'overlay';
        
$config['wm_overlay_path'] = realpath(APPPATH '../uploads/watermark.png');
        
$config['wm_vrt_alignment'] = 'bottom';
        
$config['wm_hor_alignment'] = 'right';
        
$config['wm_padding'] = '-10';
        
$this->image_lib->initialize($config);
        
$this->image_lib->watermark();

        
$this->image_lib->clear();
        unset(
$config); 

I want to do the same thing in CI4, but I see only a possibility to watermark with plane text overlay in the documentation.

Am I missing something?

Thanks