Sunday, 1 September 2013


The last few days I have been working on creating a watermark for my photo website. I decided to add one so that my images would be branded when shared on sites such as pinterest, even if the pinner does not link back to my site.

I did quite a bit of research on watermarks in terms of design, size, placement. One of the best articles I read was this one: Watermarks: Protecting Your Images, or Damaging Your Business?. Make sure to check out the linked examples and buyer's guide survey as well.

In the end I decided to go for a border with my name and website address in, rather than a watermark over the photo. Once I'd decided on a design, I then had to mess about with it to suit different sizes and orientations of images. Next I had to work out how to apply the design using ImageMagick.

I had to update the image processing script for my website and test it quite a bit to make sure it was working properly. And then I had to write a script to process all my old images to add the border to them. I've not finished that yet. Once that's done I'll need to change the css for my website to remove the css border currently added to images.

I have had to do quite a bit of reading on ImageMagick in order to get it to add the border / watermark to my images as I want. One thread I read it was stated that the PHP imagick extension is not officially supported, and it is (generally) better to use the commandline tools: Imagick read MPC error "unable to persist pixel cache"

Imagick is not supported well if at all any more and was not created by the ImageMagick team. So I am not sure what to tell you at this point other than to just use PHP exec() for everything. You are not gaining much if anything from Imagick and it does not support many of the newer Imagemagick features.

So I am happy that this is what I have already been doing.

I had an issue with ImageMagick in that it was not respecting the opacity setting of a shape in an SVG file. (This was related to adding a standard style watermark, not the border I am actually implementing). It seems that others also have this problem: Imagick doesn't render svg opacity properly. I am going to try updating ImageMagick and see if that fixes the issue. (I have already tried fill-opacity instead of opacity in the SVG but it didn't make any difference).

On an unrelated note, I found this website that covers photography on the cheap: Larry Becker's Cheap Shots 2.0. While a nice idea, I must admit that I haven't found what I have read of it so far that useful. Most of the specific deals are US only, and other info tends to be stuff I already know about (e.g. adding a PC sync socket to a flash or camera with an adapter).

One idea that they linked to, which does seem quite good, is this DIY Beauty Dish - for £1. I haven't tried making it yet, but I like the idea.

In the evening I finished writing my script for re-processing old images to add a border / watermark to them. However, after completing it, I thought that my webhost might not be too happy with me running it. It would run for quite a long time (nearly 4000 images) and would probably use up a bit of CPU (image sizes to be resized down mostly around 10 megapixels, but some over 50 megapixels). It should be okay on memory, though I'm not sure how well PHP / my script would handle on the memory front when running for so many loops.

So I think that probably I will run the script on my local machine, and then just FTP the updated files to the server. But this does mean that the script will need modifying. A job for tomorrow.

No comments: