Hey there! I'm currently working on a CLI tool to deploy WordPress apps to DigitalOcean. Check it out! It's free and open source.
Here’s a pretty code snippet for watermarking images with php.
<?php header('Content-type: image/jpeg'); $watermark = imagecreatefrompng('watermark.png'); $watermark_width = imagesx($watermark); $watermark_height = imagesy($watermark); $image = imagecreatetruecolor($watermark_width, $watermark_height); $image = imagecreatefromjpeg('photo.jpg'); $size = getimagesize('photo.jpg'); $dest_x = $size - $watermark_width - 5; $dest_y = $size - $watermark_height - 5; imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, 100); imagejpeg($image); imagedestroy($image); imagedestroy($watermark); ?>
Where photo.jpg is the image that you want to watermark. It uses gd image library which is now a standard php webhosting feature, so you should have any problems. You could learn more about working with images in php at the PHP GD Manual.
Oh, and by the way, the code highlighting plugin for wordpress is called WP-Syntax and is available at the wordpress plugins directory for free. It’s the only one I liked, out of a bunch of others. It supports over a hundred different coding languages and looks neat.