Image sandwich

See all posts Reply

Image sandwich new!
by Tim, 16 years, 4 months ago
I want to sandwich 2 images together almost a watermark application but more like grading an image on the fly, so a water mark the same size as the original with reduced opacity so that image underneath still comes through, is this possible?Reply
Re: Image sandwich new!
by colin, 16 years, 4 months ago
It is possible, if the images that you upload always have the same size. If it is the case, create an image watermark.png with these fixed dimensions. Then try something like this:

$foo->image_watermark       = 'watermark.png';
$foo->image_watermark_x     = 0;
$foo->image_watermark_y     = 0;

Note that you can't set the opacity/transparency of the watermark image. However, the watermark can be an alpha-transparent PNG. I use it often; simply create a semi transparent PNG as a watermark. You can have alpha-transparent areas, and fully transparent areas; the uploaded picture will appear underneath.Reply